Skip to content

Remove sleep() from tests #1085

@jku

Description

@jku

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions