Skip to content

[release] 1.0.1rc2: support xdist properly#50

Merged
zhming0 merged 1 commit intomainfrom
ming/te-3588
Apr 4, 2025
Merged

[release] 1.0.1rc2: support xdist properly#50
zhming0 merged 1 commit intomainfrom
ming/te-3588

Conversation

@zhming0
Copy link
Contributor

@zhming0 zhming0 commented Apr 4, 2025

We discovered that xdist doesn't work with our 1.0.0 version, the reason can be summarize in one sentence: when xdist is enabled, some hooks will get totally ignored.

But the fix is not so simple, because there isn't an official document saying which hooks will be skipped under what situation. So after a lot of experiments, I come to the following change:

  • use pytest_runtest_makereport to replace pytest_runtest_teardown hook (this gets totally skipped by xdist).
  • When xdist is activated, use worker thread to upload test result so we can read tags.
  • Add extra logging for unfinished test data situation.
  • As a side change, I went back to using BUILDKITE_ANALYTICS_DEBUG_ENABLED as debug envvar instead of the general DEBUG env var.

I have tested extensively in my local env, can confirm this work with or without xdist.

@zhming0 zhming0 requested a review from a team April 4, 2025 03:29
@zhming0 zhming0 force-pushed the ming/te-3588 branch 3 times, most recently from 7bfec10 to 8e6a67f Compare April 4, 2025 04:04

COLLECTOR_NAME='buildkite-test-collector'
VERSION='1.0.1rc1'
VERSION='1.0.1'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? This is a general release? Have you confirmed it works for the customer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point, I changed to rc2

Copy link

@niceking niceking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't really understand the full context of this PR or python but as its a rc let's get the customer to try it out!

# Strictly speaking, we do not need this hook.
# But in pytest it's hard to predict how plugins interfere each other.
# So let's be defensive here.
# If pytest_runtest_makereport runs properlly then this hood is unnecessary.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If pytest_runtest_makereport runs properlly then this hood is unnecessary.
# If pytest_runtest_makereport runs properly then this hook is unnecessary.

@zhming0 zhming0 force-pushed the ming/te-3588 branch 2 times, most recently from 4ce5338 to d1dc719 Compare April 4, 2025 04:12
@zhming0 zhming0 changed the title [release] 1.0.1: support xdist properly [release] 1.0.1rc2: support xdist properly Apr 4, 2025
@zhming0 zhming0 merged commit f4e2025 into main Apr 4, 2025
11 checks passed
@zhming0 zhming0 deleted the ming/te-3588 branch April 4, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants