rye icon indicating copy to clipboard operation
rye copied to clipboard

Cannot ctrl+c rye test

Open mitsuhiko opened this issue 11 months ago • 4 comments

Steps to Reproduce

  1. run rye sync followed by rye test in this repository
  2. observe that pytest takes a bloody long time to collect tests
  3. hit ctrl+c
  4. observe how rye exists but pytest continues to run

Expected Result

pytest should stop running.

Actual Result

pytest continues to run.

Version Info

rye 0.28.0 commit: 0.28.0 (c44dc7ec8 2024-03-07) platform: macos (aarch64) self-python: [email protected] symlink support: true uv enabled: true

Stacktrace

No response

mitsuhiko avatar Mar 07 '24 14:03 mitsuhiko

I cannot reproduce, can you specify the project this happens? For some personal project, it works well

lleites avatar Mar 07 '24 16:03 lleites

Could not reproduce in my checkout of rye

rye 0.28.0
commit: 0.28.0 (c44dc7ec8 2024-03-07)
platform: linux (x86_64)
self-python: [email protected]
symlink support: true
uv enabled: true

bluss avatar Mar 07 '24 17:03 bluss

Happens on my mac at least. Curious.

mitsuhiko avatar Mar 07 '24 17:03 mitsuhiko

Does not happen on mine

rye 0.28.0
commit: 0.28.0 (c44dc7ec8 2024-03-07)
platform: macos (aarch64)
self-python: [email protected]
symlink support: true
uv enabled: true

rye test --all works. I found --all. It's nice :)

bluss avatar Mar 07 '24 18:03 bluss

Could not reproduce either on Windows 11

rye 0.29.0
commit: 0.28.0+8 (93f00db73 2024-03-09)
platform: windows (x86_64)
self-python: [email protected]
symlink support: true
uv enabled: true

hyyking avatar Mar 09 '24 12:03 hyyking

@mitsuhiko is it similar to https://asciinema.org/a/Qz0UBIeFmQdHNYqwymDb5ixBy ? I can repro this on MacOS

rye 0.29.0
commit: 0.29.0 (42b179f36 2024-03-11)
platform: macos (aarch64)
self-python: [email protected]
symlink support: true
uv enabled: true

dsp avatar Mar 12 '24 10:03 dsp

@mitsuhiko is it similar to https://asciinema.org/a/Qz0UBIeFmQdHNYqwymDb5ixBy ? I can repro this on MacOS

rye 0.29.0
commit: 0.29.0 (42b179f36 2024-03-11)
platform: macos (aarch64)
self-python: [email protected]
symlink support: true
uv enabled: true

What happens if you just run pytest directly, is this a bug on pytest or rye?

lleites avatar Mar 12 '24 10:03 lleites

Same behaviour when running it directly:

/Users/dsp/src/sl-rye/.venv/bin/python /Users/dsp/src/sl-rye/.venv/bin/pytest --rootdir /Users/dsp/src/sl-rye --ignore /Users/dsp/src/sl-rye/rye-devtools

While it is "collecting" tests, CTRL+C is ignored. So this is not an issue with std::process:Command::status but rather the underlying pytest implementation.

dsp avatar Mar 12 '24 10:03 dsp

I wonder if this is not related to the use of anyio plugin, I cannot reproduce on personal projects that not use it. It could be related to the async nature of it.

lleites avatar Mar 12 '24 10:03 lleites

Ha, I think this should be fixed in #893

j178 avatar Mar 15 '24 14:03 j178