-
Notifications
You must be signed in to change notification settings - Fork 8.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
Scout: run tests in parallel (with spaces) #207253
base: main
Are you sure you want to change the base?
Conversation
|
||
return measurePerformance(log, '[scout setup]: ingestTestDataHook', async () => { | ||
// TODO: This should be configurable local vs cloud | ||
const configName = 'local'; |
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.
we have separate issue to enable cloud testing.
testDir: string; | ||
workers?: 1 | 2; | ||
workers?: 1 | 2 | 3; // to keep performance consistent within test suites |
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.
We can keep 3
as an option to experiment in the future. wdyt?
body: formData, | ||
headers: formData.getHeaders(), | ||
}); | ||
|
||
if (resp.data.success) { | ||
this.log.success('import success'); | ||
return resp.data; |
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.
We need response to access re-generated ids
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
cc @dmlemeshko |
Summary
This PR adds
spaceTest
interface tokbn-scout
to run space aware tests, that can be executed in parallel. Most of Discover tests were converted to parallel run because we see runtime improvement with 2 parallel workers.Experiment 1: ES data pre-ingested, running 9 Discover stateful tests in 5 files locally
1.3
min58.7
sec48.3
secConclusion: using 2 workers is the optimal solution to continue
Experiment 2: Running Discover tests for stateful/serverless in Kibana CI (starting servers, ingesting ES data, running tests)
1.7
min1.2
min-29.4%
1.7
min1.3
min-23.5%
1.8
min1.4
min-22.2%
59.9
sec51.6
sec-13.8%
Conclusion: parallel run effectiveness benefits from tests being split in more test files.
Experiment 3: Clone existing tests to have 3 times more test files and re-run tests for stateful/serverless in Kibana CI (starting servers, ingesting ES data, running tests)
4.3
min2.7
min-37.2%
4.3
min2.7
min-37.2%
Conclusion: parallel run effectiveness is increasing with more test files in place, not linear but with good test design we can expect up to 40% or maybe a bit more.
How parallel run works:
scoutSpace
fixture is loaded on Playwright worker setup (usingauto: true
config), creates a new Kibana Space, expose its id to other fixtures and deletes the space on teardown.browserAuth
fixture for parallel run caches Cookie per worker/space likerole:spaceId
. It is needed because Playwright doesn't spin up new browser for worker, but only new context.createNewCopies: true
in query, it is needed to load the same Saved Objects in parallel workers/spaces and generate new ids to work with them.scoutSpace
caches ids and allows to reach saved object by its name. This logic is different from single thread run, where we can use default ids from kbnArchives.How to run parallel tests locally, e.g. for stateful: