[flutter_tools] timeline_test.dart flaky (#116667)

* contains name instead of remove last

* fix expect

* remove and expect on elements

* delete unused code
This commit is contained in:
Jesús S Guerrero 2023-01-03 14:44:53 -06:00 committed by GitHub
parent 64e733647f
commit fe8dcf6631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,15 @@ void main() {
// The downloaded part of the timeline may contain an end event whose
// corresponding begin event happened before the start of the timeline.
if (stack.isNotEmpty) {
expect(stack.removeLast(), name);
bool pass = false;
while (stack.isNotEmpty) {
final String value = stack.removeLast();
if (value == name) {
pass = true;
break;
}
}
expect(pass, true);
}
}
}