-
Notifications
You must be signed in to change notification settings - Fork 19
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
1.0.2: test_startup_without_pattern
and test_startup_with_pattern_and_callback
fails
#154
Comments
I see same problem on my riscv64 linux box. Here is my understanding of what's happening. On fast machines, But To reproduce the issue on any machine, you can artificially make the server slower: --- a/pytest-xprocess/tests/server.py
+++ b/pytest-xprocess/tests/server.py
@@ -76,6 +76,7 @@ if __name__ == "__main__":
while True:
sleep(1)
+ sleep(1)
HOST, PORT = "localhost", int(sys.argv[1])
server = TestServer((HOST, PORT), TestHandler)
if "--ignore-sigterm" in sys.argv and sys.platform != "win32": The simplest way to make the tests pass would be to handle exceptions in the callbacks of the test cases: --- a/pytest-xprocess/tests/test_process_initialization.py
+++ b/pytest-xprocess/tests/test_process_initialization.py
@@ -126,7 +126,10 @@ def test_startup_without_pattern(tcp_port, proc_name, xprocess):
args = [sys.executable, server_path, tcp_port, "--no-children"]
def startup_check(self):
- return request_response_cycle(tcp_port, data)
+ try:
+ return request_response_cycle(tcp_port, data)
+ except Exception:
+ return False
xprocess.ensure(proc_name, Starter)
info = xprocess.getinfo(proc_name)
@@ -153,7 +156,10 @@ def test_startup_with_pattern_and_callback(
args = [sys.executable, server_path, tcp_port, "--no-children"]
def startup_check(self):
- return request_response_cycle(tcp_port, data)
+ try:
+ return request_response_cycle(tcp_port, data)
+ except Exception:
+ return False
if proc_name == "s1":
with pytest.raises(RuntimeError): But maybe the exceptions should be handled in |
@northernSage @mtelka WDYT? |
@iv-m IHNI |
Describe the bug
I run tests for
pytest-xprocess
version1.0.2
and the following tests fails:To Reproduce
Run tests. It is easily reproducible in my environment.
Expected behavior
All tests pass.
Screenshots
N/A
Environment (please complete the following information):
Additional context
I found that when I do this:
then all tests pass. It looks like the problem is some kind of race condition.
The text was updated successfully, but these errors were encountered: