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

test/threads: fix state leakage across tests #14

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

delroth
Copy link
Contributor

@delroth delroth commented Oct 31, 2022

Please double check that I didn't significantly alter the semantics of test_threaded_invalid_binary -- to me the before/after seem equivalent but I might be missing some subtlety, having a total of 15min of experience in this codebase :-)

Description of the Change

test_threaded_bad_options was only passing in CI because it was running after test_threaded_invalid_binary, which altered the base class to ignore some exceptions.

Restructure the tests by using the fact that ThreadedAustin.join will bubble up any exception that happened during startup. This avoids manipulating global state in test_threaded_invalid_binary.

Fixes #13.

Alternate Designs

n/a

Regressions

Test only change.

Verification Process

Used pytest to run the two suspect tests in isolation and confirmed they now both pass in this environment. Confirmed they also still both pass when ran together.

test_threaded_bad_options was only passing in CI because it was running
after test_threaded_invalid_binary, which altered the base class to
ignore some exceptions.

Restructure the tests by using the fact that ThreadedAustin.join will
bubble up any exception that happened during startup. This avoids
manipulating global state in test_threaded_invalid_binary.

Fixes P403n1x87#13.
@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Base: 73.79% // Head: 73.79% // No change to project coverage 👍

Coverage data is based on head (b1bbc43) compared to base (4292f1c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #14   +/-   ##
=======================================
  Coverage   73.79%   73.79%           
=======================================
  Files          14       14           
  Lines        1309     1309           
  Branches      199      199           
=======================================
  Hits          966      966           
  Misses        289      289           
  Partials       54       54           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Owner

@P403n1x87 P403n1x87 left a comment

Choose a reason for hiding this comment

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

That's a very nice clean-up of some over-engineering. Thanks a lot!

@P403n1x87 P403n1x87 merged commit 107db3b into P403n1x87:main Oct 31, 2022
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.

test_threaded_bad_options not expected to raise AustinError?
2 participants