Comments (2)
Hmm. I think it sort of works today but definitely not cleanly, since sending a signal to terminate the parent process will close the pipe used for interprocess communication causes all the workers to raise an exception when they try to write to the pipe to report the current test status.
I do have have a neglected WIP PR #271 which adds an option to use stdlib multiprocessing
instead of subprocess
which at least for POSIX systems it should sort of work because it changes how children processes are created to use fork()
which POSIX dictates that signals are propagated to children created via fork()
. Although this probably will only always work on linux, because I know Python >=3.8 doesn't use fork()
for multiprocessing by default on macOS and there might be other edge cases.
I think we probably do want to add some signal handling to stestr run to make the behavior explicit. I think the only way we can do it is register a signal handler in _run_tests
after we get a list of processes from the test_processor fixture: https://github.com/mtreinish/stestr/blob/main/stestr/commands/run.py#L667-L713 and on receiving a signal we forward it to each child process. We might also want to add signal handling to the subunit runner here: https://github.com/mtreinish/stestr/blob/main/stestr/subunit_runner/run.py to enable a graceful exit (ie finish the current test or something) for the children processes.
The one potential wrinkle with this plan I think is windows because signals behave differently there. But, that's probably not a concern because if windows doesn't support what we end up with there is nothing we can do about it.
from stestr.
Thanks Matt, this was very helpful! I'll explore a bit more in this direction and get back to you👍
from stestr.
Related Issues (20)
- Finish deprecation and removal of blacklist, black_regex, and whitelist
- Finish deprecation of sql repository type and --repository-type argument
- stestr run fails with stestr: 'run' is not a stestr command. See 'stestr --help'. with Python 3.10 HOT 3
- stestr run specific test but it is skipped by other test's skiptest requirement
- ResourceWarning messages being printed HOT 1
- stestr doesn't handle unittest.subTests well in its output log HOT 1
- Test are run out of order when using `--load-list`
- Commands not found on Debian Buster ('init' is not a stestr command.) HOT 4
- Ignore erroneous files that don't contain the required test
- pyproject.toml support
- New release? HOT 3
- Stestr does not work with python-subunit 1.4.3 and testtools 2.6.0 HOT 1
- Stestr does not work with python-subunit 1.4.3 HOT 1
- stestr==4.0.1 does not have a run command HOT 3
- Cannot use pyproject.toml configs on the first run
- Add Pytest based test executor
- Testcase run twice when import a class with testcase in python file.
- FAIL: stestr.tests.test_return_codes.TestReturnCodesToxIni.test_no_repo_dir on `python 3.12.2` HOT 2
- test failures with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stestr.