-
Notifications
You must be signed in to change notification settings - Fork 33
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
[WIP] Add dynamic scheduling operation mode #271
base: main
Are you sure you want to change the base?
Conversation
This still fails some tests but after switching away from |
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 accepting my suggestion. As per this comment this doesn't seem to work for me yet.
This commit adds an opt-in scheduler option for dynamic scheduling. Instead of partitioning the test list up-front based on historical timing data this commit lets each worker ask for the next test dynamically. This is built using python's multiprocess module to launch new workers instead of shelling out to call python via subprocess. This hopefully will provide a better worker balance since we will keep each worker occupied until there are no more tests to be run. Instead of trying to pack fill each work optimially up front. Additionally this should hopefully improve the pdb story for users who use pdb with tests. Since instead of spawning subprocesses calling python to invoke the subunit runner and reading the subunit stream from stdout and instead uses multiprocessing to fork workers and uses pipes to pass the subunit streams between workers.
Co-Authored-By: Adam Spiers <github@adamspiers.org>
This commit fixes the failing tests by catching a couple of missing things from the update. The biggest fix was that for the --no-discover case we still use a subprocess and because of that we need to tell output.ReturnCodeToSubunit to that the input is not dynamic (and therefore a Popen object) so it can handle that properly. The other major change is that the return code tests are updated so that the stdout and stderr from the subprocess calls are always decoded in the non-subunit test cases. This was done primarily for ease of debugging, but it also enabled the removal of several decode() calls when the output is parsed.
This is a refinement on the previous commit to reduce unecessary changes to the functional tests in the test_return_codes module. Mainly always decoding the output from the subprocess for testing broken things unexpectedly when a bytes object was expected.
8933610
to
e68b506
Compare
Conflicts: stestr/commands/run.py stestr/output.py stestr/test_processor.py stestr/tests/test_return_codes.py
I originally developed this feature when we still supported older python versions in stestr. The dynamic scheduling feature depends on functionality added in Python 3.5. Since then the WIP feature branch sat stale for years since that time we've bumped the minimum version of Python supported to 3.7 so the runtime check for older python versions is no longer needed.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #271 +/- ##
==========================================
- Coverage 61.79% 60.15% -1.64%
==========================================
Files 30 30
Lines 2625 2713 +88
Branches 428 448 +20
==========================================
+ Hits 1622 1632 +10
- Misses 884 957 +73
- Partials 119 124 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This commit adds an opt-in scheduler option for dynamic scheduling.
Instead of partitioning the test list up-front based on historical
timing data this commit lets each worker ask for the next test
dynamically. This is built using python's multiprocess module to
launch new workers instead of shelling out to call python via
subprocess.
This hopefully will provide a better worker balance since we will keep
each worker occupied until there are no more tests to be run. Instead
of trying to pack fill each work optimially up front. Additionally this
should hopefully improve the pdb story for users who use pdb with tests.
Since instead of spawning subprocesses calling python to invoke the
subunit runner and reading the subunit stream from stdout and instead
uses multiprocessing to fork workers and uses pipes to pass the subunit
streams between workers.