use allSettled
This commit is contained in:
parent
e51fcf296f
commit
c4f40b3549
5 changed files with 15 additions and 22 deletions
|
|
@ -127,7 +127,7 @@ export class MockAgent extends MockClient {
|
|||
|
||||
public async finish(): Promise<void> {
|
||||
await this.client.setSetting("isSyncEnabled", true);
|
||||
await Promise.all(this.pendingActions);
|
||||
await Promise.allSettled(this.pendingActions);
|
||||
await this.client.waitAndStop();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,11 +53,13 @@ async function runTest({
|
|||
}
|
||||
|
||||
try {
|
||||
await Promise.all(clients.map(async (client) => client.init()));
|
||||
await Promise.allSettled(clients.map(async (client) => client.init()));
|
||||
|
||||
for (let i = 0; i < iterations; i++) {
|
||||
console.info(`Iteration ${i + 1}/${iterations}`);
|
||||
await Promise.all(clients.map(async (client) => client.act()));
|
||||
await Promise.allSettled(
|
||||
clients.map(async (client) => client.act())
|
||||
);
|
||||
await sleep(100);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue