Skip to content

convenient_test_manager_dart runs forever when an assertion error occurs #350

Closed Answered by lehmannk
lehmannk asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, for everyone interested. Here is the solution to avoid the onError problem and endless headless runs. Simply backup & restore the onErrorhandler in your ConvenientTestSlot override:

 @override
  Future<void> appMain(AppMainExecuteMode mode) async {
    // onError overrides need to be restored in order to let the headless test manager terminate properly in case of exceptions
    // see https://github.com/fzyzcjy/flutter_convenient_test/pull/351
    FlutterExceptionHandler? originalOnError = FlutterError.onError;
    await app.main();
    FlutterError.onError = originalOnError;
  }

Replies: 2 comments 14 replies

Comment options

You must be logged in to vote
13 replies
@lehmannk
Comment options

@fzyzcjy
Comment options

@lehmannk
Comment options

@fzyzcjy
Comment options

@lehmannk
Comment options

Comment options

You must be logged in to vote
1 reply
@fzyzcjy
Comment options

Answer selected by lehmannk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants