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

Re-introduce pytest-xdist in supported envs #5431

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

webknjaz
Copy link
Member

@webknjaz webknjaz commented Jan 25, 2021

What do these changes do?

This change resurrects parallel test execution in most of the test envs. On my laptop, the full test run is almost 3x faster: 36.04s vs 105.53s (0:01:45).

Refs:

Are there changes in behavior for the user?

Nope.

Related issue number

#3419 + #3450

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@webknjaz webknjaz added infra bot:chronographer:skip This PR does not need to include a change note backport-3.8 labels Jan 25, 2021
@webknjaz webknjaz force-pushed the testing/pytest-xdist branch 3 times, most recently from 7ed6246 to 392ebbb Compare January 25, 2021 12:32
@webknjaz webknjaz marked this pull request as draft January 25, 2021 14:36
@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.17%. Comparing base (04b1212) to head (204e870).

❗ Current head 204e870 differs from pull request most recent head 83b8706. Consider uploading reports for the commit 83b8706 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5431      +/-   ##
==========================================
- Coverage   97.62%   97.17%   -0.46%     
==========================================
  Files         107       41      -66     
  Lines       33066     8860   -24206     
  Branches     3873     1424    -2449     
==========================================
- Hits        32282     8610   -23672     
+ Misses        567      133     -434     
+ Partials      217      117     -100     
Flag Coverage Δ
CI-GHA ?
OS-Linux ?
OS-Windows ?
OS-macOS ?
Py-3.10.11 ?
Py-3.10.14 ?
Py-3.11.9 ?
Py-3.12.3 ?
Py-3.8.10 ?
Py-3.8.18 ?
Py-3.9.13 ?
Py-3.9.19 ?
Py-pypy7.3.15 ?
VM-macos ?
VM-ubuntu ?
VM-windows ?
unit 97.06% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@webknjaz webknjaz force-pushed the testing/pytest-xdist branch 4 times, most recently from 7dd330f to 18dd594 Compare February 24, 2021 11:27
@webknjaz webknjaz added backport-3.9 Trigger automatic backporting to the 3.9 release branch by Patchback robot and removed backport-3.8 labels Sep 20, 2022
from typing import TYPE_CHECKING, List

try:
from asyncio import ThreadedChildWatcher

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'ThreadedChildWatcher' is not used.
@webknjaz webknjaz added the backport-3.10 Trigger automatic backporting to the 3.10 release branch by Patchback robot label Jan 28, 2024
This was referenced Apr 19, 2024
@webknjaz webknjaz linked an issue Apr 19, 2024 that may be closed by this pull request
1 task
@webknjaz webknjaz force-pushed the testing/pytest-xdist branch 2 times, most recently from b6a6440 to 1989754 Compare April 29, 2024 00:05
@webknjaz
Copy link
Member Author

@Dreamsorcerer @bdraco any ideas why the http parser tests might be failing in with pytest-xdist?

@Dreamsorcerer
Copy link
Member

Attempting to fix the Ubuntu failure in #8391.
Mac networking seems rather flaky, been seeing a lot of errors recently where the networking just doesn't seem to work.

@webknjaz
Copy link
Member Author

Oh, nice! Thanks for confirming that those are not related to this patch!

tests/test_connector.py Outdated Show resolved Hide resolved
@webknjaz
Copy link
Member Author

@Dreamsorcerer looks like there's even more flakiness coming out with the parallelism now, eh?

@webknjaz
Copy link
Member Author

@bdraco could you check https://github.com/aio-libs/aiohttp/actions/runs/8887163170/job/24401975076#step:11:8577 ? I think you were the last one to dig into the proxy tests, right? From the log

ERROR tests/test_proxy_functional.py::test_secure_https_proxy_absolute_path[pyloop-http] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <socket.socket fd=-1, family=2, type=1, proto=6>

Traceback (most recent call last):
  File "/home/runner/work/aiohttp/aiohttp/aiohttp/test_utils.py", line 481, in teardown_test_loop
    gc.collect()
ResourceWarning: unclosed <socket.socket fd=21, family=2, type=1, proto=6, laddr=('127.0.0.1', 58090), raddr=('127.0.0.1', 39771)>

it seems like there might be a live connection hanging around post-test.. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.9 Trigger automatic backporting to the 3.9 release branch by Patchback robot backport-3.10 Trigger automatic backporting to the 3.10 release branch by Patchback robot bot:chronographer:skip This PR does not need to include a change note infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use pytest-xdist?
2 participants