Skip to content

Commit

Permalink
Continue to increase time Monitor + Socket.IO for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Perki committed Apr 22, 2024
1 parent 7d3567b commit 36b02e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions components/pryv-monitor/test/monitor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Monitor', function () {
}
}
]);
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 8000));
expect(count).to.be.gt(0);
});

Expand All @@ -89,7 +89,7 @@ describe('Monitor', function () {
}
]);
await monitor.updateEvents(); // trigger refresh
await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 8000));
expect(count).to.be.gt(0);
});
});
Expand Down
10 changes: 5 additions & 5 deletions components/pryv-monitor/test/socket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ describe('Monitor + Socket.IO', function () {
expect(event.content).to.equal(eventData.content);
count++;
});
await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 6000));
await conn.api([
{
method: 'events.create',
params: eventData
}
]);

await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 8000));
monitor.stop();
expect(count).to.be.gt(0);
});
});

describe('stop', () => {
it('Monitor stops when requested', async function () {
this.timeout(4000);
this.timeout(20000);
const monitor = new pryv.Monitor(apiEndpoint, { limit: 1 })
.addUpdateMethod(new pryv.Monitor.UpdateMethod.Socket());
await monitor.start();
let count = 0;
await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 4000));
monitor.stop();

const eventData = {
Expand All @@ -73,7 +73,7 @@ describe('Monitor + Socket.IO', function () {
}
]);

await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 6000));
expect(count).to.equal(0);
});
});
Expand Down
6 changes: 3 additions & 3 deletions components/pryv-monitor/test/timer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Monitor + EventsTimer', function () {
}
]);

await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise(resolve => setTimeout(resolve, 4000));
monitor.stop();
expect(count).to.be.gt(0);
});
Expand All @@ -66,7 +66,7 @@ describe('Monitor + EventsTimer', function () {
await monitor.start();

let count = 0;
await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 4000));
monitor.stop();

// listener is added "after" so we don't get events loaded at start
Expand All @@ -87,7 +87,7 @@ describe('Monitor + EventsTimer', function () {
}
]);

await new Promise(resolve => setTimeout(resolve, 1000));
await new Promise(resolve => setTimeout(resolve, 5000));
expect(count).to.equal(0);
});
});
Expand Down

0 comments on commit 36b02e1

Please sign in to comment.