Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 93138f0

Browse files
committed
test(NODE-4763): use times:1 for failpoint to explicitly set failure
1 parent 1d20d16 commit 93138f0

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

‎test/integration/change-streams/change_stream.test.ts‎

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,20 +1865,6 @@ describe('Change Streams', function () {
18651865
collection = client.db(dbName).collection(collectionName);
18661866

18671867
changeStream = collection.watch([]);
1868-
1869-
// Configure a fail point with skip: 1 to simulate a server failure on the second `getMore`,
1870-
// triggering the resume process.
1871-
await client.db('admin').command({
1872-
configureFailPoint: is4_2Server(this.configuration.version)
1873-
? 'failCommand'
1874-
: 'failGetMoreAfterCursorCheckout',
1875-
mode: { skip: 1 },
1876-
data: {
1877-
failCommands: ['getMore'],
1878-
errorCode: resumableError.code,
1879-
errmsg: resumableError.message
1880-
}
1881-
} as FailCommandFailPoint);
18821868
});
18831869

18841870
afterEach(async function () {
@@ -1905,6 +1891,18 @@ describe('Change Streams', function () {
19051891
fullDocument: { a: 1 }
19061892
});
19071893

1894+
await client.db('admin').command({
1895+
configureFailPoint: is4_2Server(this.configuration.version)
1896+
? 'failCommand'
1897+
: 'failGetMoreAfterCursorCheckout',
1898+
mode: { times: 1 },
1899+
data: {
1900+
failCommands: ['getMore'],
1901+
errorCode: resumableError.code,
1902+
errmsg: resumableError.message
1903+
}
1904+
} as FailCommandFailPoint);
1905+
19081906
await collection.insertOne({ a: 2 });
19091907
const change2 = await changeStream.next();
19101908
expect(change2).to.containSubset({
@@ -1925,6 +1923,18 @@ describe('Change Streams', function () {
19251923
fullDocument: { a: 1 }
19261924
});
19271925

1926+
await client.db('admin').command({
1927+
configureFailPoint: is4_2Server(this.configuration.version)
1928+
? 'failCommand'
1929+
: 'failGetMoreAfterCursorCheckout',
1930+
mode: { times: 1 },
1931+
data: {
1932+
failCommands: ['getMore'],
1933+
errorCode: resumableError.code,
1934+
errmsg: resumableError.message
1935+
}
1936+
} as FailCommandFailPoint);
1937+
19281938
await collection.insertOne({ a: 2 });
19291939
const change2 = await changeStream.tryNext();
19301940
expect(change2).to.containSubset({
@@ -1947,6 +1957,18 @@ describe('Change Streams', function () {
19471957
fullDocument: { a: 1 }
19481958
});
19491959

1960+
await client.db('admin').command({
1961+
configureFailPoint: is4_2Server(this.configuration.version)
1962+
? 'failCommand'
1963+
: 'failGetMoreAfterCursorCheckout',
1964+
mode: { times: 1 },
1965+
data: {
1966+
failCommands: ['getMore'],
1967+
errorCode: resumableError.code,
1968+
errmsg: resumableError.message
1969+
}
1970+
} as FailCommandFailPoint);
1971+
19501972
await collection.insertOne({ a: 2 });
19511973
const change2 = await willBeChange.next();
19521974
expect(change2.value[0]).to.containSubset({

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /