Skip to content
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

Fix retry function not stopping for long time after sending an interrupt #2486

Merged
merged 21 commits into from
Jan 11, 2024

Conversation

kartik727
Copy link
Contributor

Description

For interactive use, the retry function could not be interrupted until it came out of sleep.
For example, when going to sleep for 60 seconds using time.sleep(60), if the user sends a
keyboard interrupt, that interrupt does not stop the code execution until the 60 seconds are
over and the program comes out of sleep.

By doing 60 calls of time.sleep(1) instead, the program will halt in at most 1 second after
the user sends a keyboard interrupt, while the behavior is unchanged in cases where no interrupt
is sent.

The code falls back to the original behavior of time.sleep(retry_delay) if non-integer delay
time is provided.

Checklist

  • I have added screenshots above for all UI changes.
  • I have added e2e tests for all UI changes.
  • Documentation was updated if it was needed.

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (49906bb) 85.60% compared to head (e727bf4) 92.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2486      +/-   ##
==========================================
+ Coverage   85.60%   92.41%   +6.80%     
==========================================
  Files          85      108      +23     
  Lines        4648     5419     +771     
==========================================
+ Hits         3979     5008    +1029     
+ Misses        669      411     -258     
Flag Coverage Δ
unittests 92.41% <100.00%> (+6.80%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imatiach-msft imatiach-msft merged commit 010289f into microsoft:main Jan 11, 2024
100 of 101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants