Reverts: flutter/flutter#150287
Initiated by: jtmcdole
Reason for reverting: other memperf tests don't wait for or send a TAPPED; so they fail.
Original PR Author: jtmcdole
Reviewed By: {gaaclarke}
This change reverts the following previous change:
Initial tap is missing sometimes; either its never delivered or it is delivered before gesture controller is hooked up.
1: Update the two perf tests to output when TAPPED is received
2: Update the MemoryTest to keep tapping while waiting for TAPPED
Tested on devicelab:
* setting iterations=1
* removing the timeout before READY
* running tests in a while loop
Before this change, you could get the test to hang often. After this change you'll see "tapping device... [x]" where x is the counter.
Fixes #150096
This commit is contained in:
@@ -2071,34 +2071,9 @@ class MemoryTest {
|
||||
await launchApp();
|
||||
await recordStart();
|
||||
|
||||
// Keep "tapping" the device till it responds with the string we expect,
|
||||
// or throw an error instead of tying up the infrastructure for 30 minutes.
|
||||
prepareForNextMessage('TAPPED');
|
||||
bool tapped = false;
|
||||
int tapCount = 0;
|
||||
await Future.any(<Future<void>>[
|
||||
() async {
|
||||
while (true) {
|
||||
if (tapped) {
|
||||
break;
|
||||
}
|
||||
tapCount += 1;
|
||||
print('tapping device... [$tapCount]');
|
||||
await device!.tap(100, 100);
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
}(),
|
||||
() async {
|
||||
print('awaiting "tapped" message... (timeout: 10 seconds)');
|
||||
try {
|
||||
await receivedNextMessage?.timeout(const Duration(seconds: 10));
|
||||
} finally {
|
||||
tapped = true;
|
||||
}
|
||||
}(),
|
||||
]);
|
||||
|
||||
prepareForNextMessage('DONE');
|
||||
print('tapping device...');
|
||||
await device!.tap(100, 100);
|
||||
print('awaiting "done" message...');
|
||||
await receivedNextMessage;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user