[NoQA] Add sleep cooldowns to e2e tests#30635
Conversation
|
@aldo-expensify Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const coolDownLogs = Logger.progressInfo(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
| coolDownLogs.updateText(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
|
|
||
| await sleep(config.BOOT_COOL_DOWN); |
There was a problem hiding this comment.
Having the cooldown right at the beginning should hopefully lower the chances of heat throttling from the previous run (which we have no control over and will be a completely different AWS DF customer/app). It also gives the time to cool down between test suites.
| await killApp('android', config.APP_PACKAGE); | ||
|
|
||
| testLog.updateText(`Coolin down phone 🧊 ${config.SUITE_COOL_DOWN / 1000}s\n`); | ||
| await sleep(config.SUITE_COOL_DOWN); |
There was a problem hiding this comment.
Adding the cool down between booting the app again, had the side-effect of actually causing a cold boot, which increased TTI/bundle load JS times significantly but also stabilized standard deviation.
Co-authored-by: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com>
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.95-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.95-9 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.96-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
Details
We are still seeing potentially flaky results on the e2e tests. Our tests on a local device, have shown there is a lot of variance due to thermal throttling. We also discovered that killing the app and immediately starting it again would cause a warm boot instead of a cold boot, which seems to skew the numbers and add a greater variance to the results.
Before doing another major refactoring of the tests, we decided to give sleep cooldowns a try.
a) Add a large cooldown period at the beginning of each test suite, such as limiting the variance of heat build-up from our own runs but at the same time from any previous run on the device in the device farm.
b) A smaller cooldown between tests should help the phone clear caches and do a cold boot, thus eliminating caching variance and limiting the effects of thermal throttling.
In our tests, these cooldowns cut down the standard deviation of the tests in half. So we expect to see flakiness on the production system also go down. As a side note, the reported TTI/bundle load time also went up, but this is an artifact of previously measuring warm boots, instead of cold boots.
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop