mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-55159: Avoid using assert.commandWorked() to wait for writeConcern in an assert.soon() loop
This commit is contained in:
parent
1f244b3322
commit
e793b35538
@ -88,12 +88,10 @@ m0.getDB("db1").createRole({
|
||||
rstest.add();
|
||||
rstest.reInitiate();
|
||||
|
||||
// This write will have to wait on the initial sync to complete before progressing.
|
||||
assert.soonNoExcept(() => {
|
||||
assert.commandWorked(rstest.getPrimary().getDB("db1")["aCollection"].insert(
|
||||
{a: "afterSecondNodeAdded"}, {writeConcern: {w: 2, wtimeout: 60 * 1000}}));
|
||||
return true;
|
||||
});
|
||||
// Do a write after the node has completed initial sync.
|
||||
rstest.awaitSecondaryNodes();
|
||||
assert.commandWorked(rstest.getPrimary().getDB("db1")["aCollection"].insert(
|
||||
{a: "afterSecondNodeAdded"}, {writeConcern: {w: 2}}));
|
||||
|
||||
rstest.getPrimary().getDB("db1").createRole({
|
||||
role: "r3",
|
||||
|
Loading…
Reference in New Issue
Block a user