Take the race out of the chat seen-sync test
The open chat acknowledged after 20 ms of real time, so on a loaded machine it could fire before the assertion that the other device still shows New. That failed the delivery gate of runs 304 and 318.
This commit is contained in:
@@ -25,7 +25,9 @@ class _Device {
|
||||
ChatRepository(client),
|
||||
localStore: local,
|
||||
nowMillis: () => clock(),
|
||||
activeAckDelay: const Duration(milliseconds: 20),
|
||||
// Long enough that a loaded machine finishes `settle()` before the
|
||||
// open chat acknowledges: at 20 ms the gate lost this race under load.
|
||||
activeAckDelay: const Duration(milliseconds: 400),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,8 +131,8 @@ void main() {
|
||||
expect(phone.isNew('ses_a'), isTrue);
|
||||
expect(web.isNew('ses_a'), isFalse);
|
||||
|
||||
// The open chat acknowledges once its stream goes quiet (20 ms here).
|
||||
for (var i = 0; i < 100 && server.state.chatSeen['ses_a'] != 7000; i++) {
|
||||
// The open chat acknowledges once its stream goes quiet (400 ms here).
|
||||
for (var i = 0; i < 300 && server.state.chatSeen['ses_a'] != 7000; i++) {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 20));
|
||||
}
|
||||
await settle();
|
||||
|
||||
Reference in New Issue
Block a user