Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch .firstWhere error in homework_api.dart. #673

Merged
merged 3 commits into from
Jul 1, 2023

Conversation

Jonas-Sander
Copy link
Collaborator

Found this while trying to debug the integration tests.
It's nothing really that showed up in the CI from what I know but doesn't hurt to fix it I guess.
This is an error that shows up after a test case already failed. See below.

PS F:\Development\projects\sharezone-app\app> fvm flutter test integration_test --flavor dev --dart-define USER_1_EMAIL=**** --dart-define USER_1_PASSWORD=****
>> 
Running Gradle task 'assembleDevDebug'...                         152,5s
√  Built build\app\outputs\flutter-apk\app-dev-debug.apk.
Installing build\app\outputs\flutter-apk\app-dev-debug.apk...         4,0s
00:00 +0: (setUpAll)
00:00 +0: Authentication User should be able to sign in
00:00 +0 -1: Authentication User should be able to sign in
00:00 +0 -1: (setUpAll) [E]
  Bad state: No element
  dart:async                                                                                                   Stream.firstWhere
  package:sharezone/util/api/homework_api.dart 47:22                                                           new HomeworkGateway
  package:sharezone/util/api.dart 74:20                                                                        new SharezoneGateway._
  package:sharezone/util/api.dart 47:29                                                                        new SharezoneGateway
  package:sharezone/main/run_app.dart 140:26                                                                   initializeDependencies.<fn>
  dart:async                                                                                                   _AsyncStarStreamController.add
  package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart                MethodChannelFirebaseAuth.authStateChanges
  ===== asynchronous gap ===========================
  dart:async                                                                                                   _ForwardingStream.listen
  package:sharezone/main/run_app.dart 137:30                                                                   initializeDependencies
  ===== asynchronous gap ===========================
  dart:async                                                                                                   _CustomZone.registerUnaryCallback
  package:sharezone/main/run_app.dart 94:3                                                                     initializeDependencies
  f:/Development/projects/sharezone-app/app/integration_test/app_test.dart 23:26                               main.<fn>
  ===== asynchronous gap ===========================
  package:stream_channel                                                                                       _GuaranteeSink.add
  c:/Users/jonas/AppData/Local/Temp/flutter_tools.d68523da/flutter_test_listener.e0221e09/listener.dart 53:22  main.<fn>

  This test failed after it had already completed. Make sure to use [expectAsync]
  or the [completes] matcher when testing async code.
  dart:async                                                                                                   Stream.firstWhere
  package:sharezone/util/api/homework_api.dart 47:22                                                           new HomeworkGateway
  package:sharezone/util/api.dart 74:20                                                                        new SharezoneGateway._
  package:sharezone/util/api.dart 47:29                                                                        new SharezoneGateway
  package:sharezone/main/run_app.dart 140:26                                                                   initializeDependencies.<fn>
  dart:async                                                                                                   _AsyncStarStreamController.add
  package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart                MethodChannelFirebaseAuth.authStateChanges
  ===== asynchronous gap ===========================
  dart:async                                                                                                   _ForwardingStream.listen
  package:sharezone/main/run_app.dart 137:30                                                                   initializeDependencies
  ===== asynchronous gap ===========================
  dart:async                                                                                                   _CustomZone.registerUnaryCallback
  package:sharezone/main/run_app.dart 94:3                                                                     initializeDependencies
  f:/Development/projects/sharezone-app/app/integration_test/app_test.dart 23:26                               main.<fn>
  ===== asynchronous gap ===========================
<asynchronous suspension>
  User should be able to sign in
════════════════════════════════════════════════════════════════════════════════════════════════════
00:08 +0 -2: Authentication User should be able to sign in [E]
  Test failed. See exception logs above.
  The test description was: User should be able to sign in

@docs-page
Copy link

docs-page bot commented May 23, 2023

To view this pull requests documentation preview, visit the following URL:

docs.page/sharezoneapp/sharezone-app~673

Documentation is deployed and generated using docs.page.

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit ce557c5):

https://sharezone-test--pr673-catch-first-where-er-sl4n43wj.web.app

(expires Tue, 30 May 2023 19:48:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b

Copy link
Member

@nilsreichardt nilsreichardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jonas-Sander Jonas-Sander added this pull request to the merge queue May 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 24, 2023
@nilsreichardt nilsreichardt added this pull request to the merge queue Jul 1, 2023
Merged via the queue into main with commit 7db8164 Jul 1, 2023
@nilsreichardt nilsreichardt deleted the catch-first-where-error branch July 1, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants