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

ngclient coverage: SlowRetrievalError testing #1552

Closed
sechkova opened this issue Aug 30, 2021 · 0 comments · Fixed by #1564
Closed

ngclient coverage: SlowRetrievalError testing #1552

sechkova opened this issue Aug 30, 2021 · 0 comments · Fixed by #1564
Assignees
Labels
backlog Issues to address with priority for current development goals ngclient testing
Milestone

Comments

@sechkova
Copy link
Contributor

sechkova commented Aug 30, 2021

Description of issue or feature request:

Add test for fetcher/requests_fetcher covering the case of urllib3.ReadTimeoutError/tuf.SlowRetrievalError.
This can be achieved by using slow_retrieval_server.py instead of simple_servier.py for serving the test file.

One gotcha is that by default RequestFetcher.socket_timeout is set to 4s and the same value is used both for socket connect and read timeout. It means that the value would have to be modified to speed up the test case.
For example:

    # Read timeout
    def test_read_timeout(self):
        self.fetcher.socket_timeout = (4, 0.1) # connect timeout: 4s, read timeout: 0.1s
        # Launch a new "slow retrieval" server sending one byte each 40s
        slow_server_process_handler = utils.TestServerProcess(log=logger, server='slow_retrieval_server.py')
        ...
@sechkova sechkova self-assigned this Sep 1, 2021
@sechkova sechkova added the backlog Issues to address with priority for current development goals label Sep 1, 2021
@sechkova sechkova added this to the Sprint 7 milestone Sep 1, 2021
@jku jku linked a pull request Sep 8, 2021 that will close this issue
3 tasks
@jku jku closed this as completed in #1564 Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues to address with priority for current development goals ngclient testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant