-
Notifications
You must be signed in to change notification settings - Fork 42
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
Optimize tests to run in parallel #1019
Conversation
d6a47da
to
fcfbc82
Compare
9ea8afe
to
cdccc4d
Compare
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.
Thanks a lot for working on this @inancgumus ! 🙌
Just made a couple of comments. Also, I think there are a few tests missing to be executed in parallel or add a comment explaining why the can't not be run as such.
Unit tests:
- TestBrowserContextOptionsPermissions
- TestNewBrowserContext
- TestConnection
- TestConnectionClosureAbnormal
- TestConnectionSendRecv
- TestConnectionCreateSession
- TestContextWithDoneChan
- TestPageLocator
Integration tests:
- TestLocatorPress
Thank you for the review 🙇
Ah, I missed these ones; thanks! I'll make them parallel.
I had sent this PR before our today's discussion in #1007. I was expecting #1007 to use globals, and it wouldn't make sense for this test to be parallel. After the discussion we had, we can make it parallel. WDYT? |
122818f
to
9cd296e
Compare
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.
LGTM 👏
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.
Nice! This is awesome! It takes much less time on my machine to run through all the tests.
Before: ~45 sec After : ~20 sec This is measured on my 10-core machine. The results will drastically change depending on the number of cores you have.
This makes tests to run in parallel depending on a CI runner's number of cores.
We can still get the output. Do we need the extra details like a progress bar?
As the only current platform is Ubuntu.
Co-authored-by: ka3de <[email protected]>
After having a discussion, we decided to make this parallel. See the related discussion here: #1007 (comment)
After having a discussion, we decided to make this parallel. See the related discussion here: #1007 (comment)
bdcddb1
to
c78e86c
Compare
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.
Thanks for this 🙂
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.
LGTM.
What?
Why?
-q
flag. With the flag, the result looks clearer to read and debug without the k6 banner and progress bar.Here are the results after this change (On a 10-core machine):
On CI, it's the same because our runner runs on a 2-core. We can make this much faster if/when we run it on a more powerful runner.
Checklist
Related PR(s)/Issue(s)
Updates #1018