-
Notifications
You must be signed in to change notification settings - Fork 38
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
Enable cltr-c tests on windows #2412
Enable cltr-c tests on windows #2412
Conversation
|
Turns out Ctrl-C doesn't actually work on the windows client in many cases, since synchronicity (though actually the underlying concurrent.futures.Future) doesn't support aborting a long running blocking call. Attempt at fix in modal-labs/synchronicity#179 |
raise KeyboardInterrupt() | ||
|
||
original_sigint_handler = None | ||
def run_async_gen( |
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.
Just pulled this out of the Runner
here and made it use the identical Runner
implementation from synchronicity itself instead
@@ -27,7 +27,7 @@ install_requires = | |||
grpclib==0.4.7 | |||
protobuf>=3.19,<5.0,!=4.24.0 | |||
rich>=12.0.0 | |||
synchronicity~=0.8.3 | |||
synchronicity~=0.9.1 |
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.
This version upgrade the actual windows issues
@@ -54,3 +55,25 @@ def deploy_app_externally( | |||
print(f"Deploying app failed!\n### stdout ###\n{stdout_s}\n### stderr ###\n{stderr_s}") | |||
raise Exception("Test helper failed to deploy app") | |||
return stdout_s | |||
|
|||
|
|||
class PopenWithCtrlC(subprocess.Popen): |
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.
We have an identical helper in the tests of synchronicity, but it's not part of the synchronicity package, so we can't reuse it here
@prbot approve |
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.
Please request a reviewer to follow up with a post-merge review.
We were previously not testing Ctrl-C behavior on windows since SIGINT doesn't work and the python standard library makes it tricky to send CTRL_C_EVENT to a subprocess.
This was worked around in recent #2322 and this patch generalizes that fix and reactivates our CLI tests for windows