Skip to content

Commit

Permalink
add test that demonstrates #123
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jan 24, 2023
1 parent 874b523 commit 584e881
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions testing/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,31 @@ def test_popen_args(spec, expected_args):
expected_args = expected_args + ["-u", "-c", gateway_io.popen_bootstrapline]
args = gateway_io.popen_args(execnet.XSpec(spec))
assert args == expected_args


@pytest.mark.parametrize(
"interleave_getstatus",
[
pytest.param(True, id="interleave-remote-status"),
pytest.param(
False,
id="no-interleave-remote-status",
marks=pytest.mark.xfail(
reason="https://github.com/pytest-dev/execnet/issues/123",
),
),
],
)
def test_regression_gevent_hangs(group, interleave_getstatus):
pytest.importorskip("gevent")
gw = group.makegateway("popen//execmodel=gevent")

print(gw.remote_status())

def sendback(channel):
channel.send(1234)

ch = gw.remote_exec(sendback)
if interleave_getstatus:
print(gw.remote_status())
assert ch.receive(timeout=0.5) == 1234

0 comments on commit 584e881

Please sign in to comment.