Skip to content

tests: increase TIMEOUT_AWAIT_WRITE and update requests #3930

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

Merged
merged 2 commits into from
Aug 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tests.mixins.stream_hls: increase TIMEOUT_AWAIT_WRITE timeout, use --…
…durations 10 for pytest

`self.rebuild_proxies(request, self.proxies))` seems to slow down `requests`

psf/requests@60ea7f0#diff-c80d84057edadb04b5615f7169c55f88ccda358d7c20af966afb20c0d0d1056a

which results in a pytest timeout, because 5 seconds is not enough on windows

```
with kwargs.setdefault('proxies', self.proxies)

============================================================================================ slowest 10 durations =============================================================================================
0.86s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128
0.53s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_key_uri_override
0.43s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_with_map
0.36s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_padding_content
0.30s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_padding_length
0.30s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_block_length
```

```
with kwargs.setdefault('proxies', self.rebuild_proxies(request, self.proxies))

============================================================================================ slowest 10 durations =============================================================================================
10.01s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128
9.80s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_key_uri_override
5.63s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_padding_length
5.22s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_with_map
2.97s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_block_length
2.95s call     tests/streams/test_hls.py::TestHLSStreamEncrypted::test_hls_encrypted_aes128_incorrect_padding_content
```

---

also show the 10 slowest tests on pytest
  • Loading branch information
back-to committed Aug 22, 2021
commit 149f95f7f34feafd37133ce11dd5c8b07e7decee
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: "! grep -Ev '^644' <(git ls-files src/ tests/ | xargs stat '--format=%a %n')"
- name: Test
continue-on-error: ${{ matrix.continue || false }}
run: pytest -r a --cov --cov-branch --cov-report=xml
run: pytest -r a --cov --cov-branch --cov-report=xml --durations 10
- name: Upload coverage data
if: github.event_name != 'schedule'
continue-on-error: ${{ matrix.continue || false }}
Expand Down
2 changes: 1 addition & 1 deletion tests/mixins/stream_hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

TIMEOUT_AWAIT_READ = 5
TIMEOUT_AWAIT_READ_ONCE = 5
TIMEOUT_AWAIT_WRITE = 5
TIMEOUT_AWAIT_WRITE = 60 # https://github.com/streamlink/streamlink/issues/3868
TIMEOUT_AWAIT_CLOSE = 5


Expand Down