6176f17f0d
There were two issues here: 1. During shutdown, when trying to unpause and resume all threads we could get "Service has Disappeared" responses if the app was already shutting down. These need ignoring. This is fixed with `_withErrorHandling` in preventBreakingAndResume. 2. The test teardown would always try to send a terminate request even if the test had already sent it, which could result in a second terminate request not being responded to (because the app shutdown before it could respond, because it had already had a terminate request). This is fixed by the teardown code only sending terminate() if it hadn't already been sent. Fixes https://github.com/dart-lang/sdk/issues/51970. Change-Id: I1baa857eb4bb7e5616fccdb193fe9213cd9452f1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294020 Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>