-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NoQA] Add sleep cooldowns to e2e tests #30635
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
071bacb
Move sleep to beginning of each test
ospfranco 0682682
Add cooldown between tests
ospfranco f8acc3c
Allow sleep between runs
ospfranco 5da00d1
Modify runs and cooldowns
ospfranco 9a8800d
Remove ESLINT comment
ospfranco 0bf5289
Remove modified package script
ospfranco 2af3d61
Add code comments
ospfranco c6adba2
Increate timeout to AWS DF action
ospfranco 4a2e3eb
Update tests/e2e/testRunner.js
ospfranco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ const math = require('./measure/math'); | |
const writeTestStats = require('./measure/writeTestStats'); | ||
const withFailTimeout = require('./utils/withFailTimeout'); | ||
const reversePort = require('./utils/androidReversePort'); | ||
const sleep = require('./utils/sleep'); | ||
|
||
// VARIABLE CONFIGURATION | ||
const args = process.argv.slice(2); | ||
|
@@ -202,6 +203,15 @@ const runTests = async () => { | |
} | ||
} | ||
|
||
const coolDownLogs = Logger.progressInfo(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
coolDownLogs.updateText(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
|
||
// 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 sleep(config.BOOT_COOL_DOWN); | ||
coolDownLogs.done(); | ||
|
||
server.setTestConfig(testConfig); | ||
|
||
const warmupLogs = Logger.progressInfo(`Running warmup '${testConfig.name}'`); | ||
|
@@ -229,7 +239,17 @@ const runTests = async () => { | |
progressText = `Suite '${testConfig.name}' [${testIndex + 1}/${numOfTests}], iteration [${i + 1}/${config.RUNS}]\n`; | ||
testLog.updateText(progressText); | ||
|
||
await restartApp(); | ||
Logger.log('Killing app...'); | ||
await killApp('android', config.APP_PACKAGE); | ||
|
||
testLog.updateText(`Coolin down phone 🧊 ${config.SUITE_COOL_DOWN / 1000}s\n`); | ||
|
||
// 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. | ||
await sleep(config.SUITE_COOL_DOWN); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
|
||
Logger.log('Starting app...'); | ||
await launchApp('android', config.APP_PACKAGE); | ||
|
||
// Wait for a test to finish by waiting on its done call to the http server | ||
try { | ||
|
@@ -250,15 +270,6 @@ const runTests = async () => { | |
} | ||
} | ||
testLog.done(); | ||
|
||
// If we still have tests add a cool down period | ||
if (testIndex < numOfTests - 1) { | ||
const coolDownLogs = Logger.progressInfo(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
coolDownLogs.updateText(`Cooling down for ${config.COOL_DOWN / 1000}s`); | ||
// eslint-disable-next-line no-loop-func | ||
await new Promise((resolve) => setTimeout(resolve, config.COOL_DOWN)); | ||
coolDownLogs.done(); | ||
} | ||
} | ||
|
||
// Calculate statistics and write them to our work file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = function sleep(ms) { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms); | ||
}); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.