Skip to content

PYTHON-2474 Fix non-disabled client_knobs bug in Data Lake tests #537

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
Dec 22, 2020

Conversation

ShaneHarvey
Copy link
Member

No description provided.

def setUpClass(cls):
super(DataLakeTestSpec, cls).setUpClass()
# Skip these tests unless connected to data lake.
if not client_context.is_data_lake:
raise unittest.SkipTest('Not connected to Atlas Data Lake')
Copy link
Member Author

@ShaneHarvey ShaneHarvey Dec 22, 2020

Choose a reason for hiding this comment

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

Explanation:

  1. The super class' setUpClass method calls client_knobs.enable().
  2. Here we raise SkipTest
  3. tearDownClass is never called because setUpClass raised an error.
  4. The side-effects of client_knobs are still present.

The change here fixes the bug by raising SkipTest before calling setUpClass.

Copy link
Contributor

@prashantmital prashantmital left a comment

Choose a reason for hiding this comment

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

Nice work diagnosing this!

@ShaneHarvey ShaneHarvey merged commit 2eecf52 into mongodb:master Dec 22, 2020
@ShaneHarvey ShaneHarvey deleted the PYTHON-2474-real-fix branch December 22, 2020 01:54
ShaneHarvey added a commit that referenced this pull request Dec 22, 2020
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