Add pytest-timeout
and refactor requirements.txt
files
#3509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After some difficulties I had with a hanging test in #3501, I've decided to add a timeout mechanism to the PyTest tests. This is trivially done simply by adding a requirement for the
pytest-timeout
plugin and setting a timeout value in thepytest.ini
file. Once this change is merged, the PyTest tests will henceforth be aborted if they run longer than 300 seconds (5 minutes). Note that affects only tests run under PyTest, which includes the unit tests and the functional tests but not the Agent "legacy" tests (which, I think, already provide timeouts). Hopefully 5 minutes is long enough for individual tests; if not, we can easily increase the limit.In the course of making this change, I noted that we have a bunch of redundancy and similar silliness in our Python requirements files for the Agent, Client, and Server, and the "test" ones are referenced (AFAICT) only from the common
tox.ini
file, so there isn't much need (at the moment, anyway) to maintain strict separation between them since they are always referenced together.Thus, rather than adding the new
pytest-timeout
dependency in multiple places, this PR adds it once to a new, top-leveltest-requirements.txt
which contains all the dependencies of the testing system(s) which are common between the Agent, Client, and Server, and it removes the common requirements from the Client- and Server-specifictest-requirements.txt
files (the Agent-specifictest-requirements.txt
file ended up empty so I removed it, and so Git regards the creation of the new file as a "rename" of the Agent one), and it fixes up thetox.ini
file to match.[The PR is in Draft mode pending proof that the tests still work under the new organization.]