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())), ); }); });