From 4c0e4b8f28256aea73e200698dbebb6d2fae3255 Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Fri, 14 Aug 2026 16:50:26 +0200 Subject: [PATCH] test(supabase_flutter): deflake the expired session stream expectation --- packages/supabase_flutter/test/supabase_flutter_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/supabase_flutter/test/supabase_flutter_test.dart b/packages/supabase_flutter/test/supabase_flutter_test.dart index dbb958d6e..031f8c5a8 100644 --- a/packages/supabase_flutter/test/supabase_flutter_test.dart +++ b/packages/supabase_flutter/test/supabase_flutter_test.dart @@ -78,12 +78,12 @@ void main() { }); test('emits exception when no auto refresh', () async { - // Give it a delay to wait for recoverSession to throw - await Future.delayed(const Duration(milliseconds: 100)); - + // The session recovery emits a `signedOut` event before the failure + // reaches the stream, and the subject replays only the latest event, + // so skip past any data events until the error arrives. await expectLater( Supabase.instance.client.auth.onAuthStateChange, - emitsError(isA()), + emitsThrough(emitsError(isA())), ); }); });