mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 02:32:52 +00:00
[dds/dap] Fix flaky tests waiting for breakpoint resolved events on slow bots
This test shows up as flaky quite often. It's waiting for breakpoint Resolved events by just calling `await pumpEventQueue(times: 5000);` but it appears this sometimes doesn't get all of the events. This change waits up to 5s for the events to arrive (because we unfortunately have no signal to know when they should have come through). I'm hopeful 5s is more than enough and this won't flake, but we could increase this as not - the goal of this test is not to verify performance but just ensure the events do arrive. Change-Id: Ia2236b65bbb5d11e2a5519d49869c6b87202a940 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367301 Reviewed-by: Helin Shiah <helinx@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
parent
fb057ea4e0
commit
e43bbe32fa
|
@ -100,7 +100,13 @@ main() {
|
|||
}
|
||||
}
|
||||
|
||||
await pumpEventQueue(times: 5000);
|
||||
// Wait up to a few seconds for the resolved events to come through to
|
||||
// allow for slow CI bots, but exit early if they all arrived.
|
||||
final testUntil = DateTime.now().toUtc().add(const Duration(seconds: 5));
|
||||
while (DateTime.now().toUtc().isBefore(testUntil) &&
|
||||
resolvedBreakpoints.length < addedBreakpoints.length) {
|
||||
await pumpEventQueue(times: 5000);
|
||||
}
|
||||
await breakpointResolveSubscription.cancel();
|
||||
|
||||
// Ensure every breakpoint that was added was also resolved.
|
||||
|
|
Loading…
Reference in a new issue