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

Remove sleep() from tests #1085

Closed
jku opened this issue Jul 18, 2020 · 1 comment
Closed

Remove sleep() from tests #1085

jku opened this issue Jul 18, 2020 · 1 comment

Comments

@jku
Copy link
Member

jku commented Jul 18, 2020

Description of issue or feature request:

Tests use sleep() quite a lot: this makes them slow, and they still don't always protect whatever the sleep is trying to protect.

Current behavior:

  • python3 test_updater.py takes 25 seconds to run 38 tests
  • Running the same command immediately again often fails (the sockets are still in TIME-WAIT state for a minute or so)
  • Sometimes subprocess killing fails silently

Status:
I have a work-in-progress branch: https://github.com/jku/tuf/tree/remove-sleep-wip : it might not take care of all corner cases yet, the comments are still about the old implementation and it only covers test_updater.py but it does take execution time of python3 test_updater.py from 25 seconds to 8 seconds.

I'm filing this so I don't forget the branch on the holiday -- but 🥇 for anyone who takes it, polishes and extends it

@jku
Copy link
Member Author

jku commented Aug 17, 2020

Fixed in pr #1096

@jku jku closed this as completed Aug 17, 2020
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

No branches or pull requests

1 participant