From 891d55ea51249bb26ff9ba858b1aa676b73e9d3c Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 22 Jul 2021 13:20:25 +0530 Subject: [PATCH] test(persistence): fix flaky channel query test --- .../test/src/dao/channel_query_dao_test.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_persistence/test/src/dao/channel_query_dao_test.dart b/packages/stream_chat_persistence/test/src/dao/channel_query_dao_test.dart index 62a3df15..fcc58bcf 100644 --- a/packages/stream_chat_persistence/test/src/dao/channel_query_dao_test.dart +++ b/packages/stream_chat_persistence/test/src/dao/channel_query_dao_test.dart @@ -84,9 +84,9 @@ void main() { cid: cids[index], createdBy: users[index], config: ChannelConfig(), - extraData: {'test_custom_field': math.Random().nextInt(100)}, + extraData: {'test_custom_field': 3 + index}, createdAt: now, - memberCount: math.Random().nextInt(100), + memberCount: 3 + index, lastMessageAt: now.add(Duration(hours: index)), ), ).reversed.toList(growable: false); @@ -99,6 +99,9 @@ void main() { } group('getChannels', () { + + tearDown(() async => database.flush()); + final filter = Filter.in_('members', const ['testUserId']); test('should return empty list of channels', () async {