Skip to content

Fix flakey test test_disable_logging#26871

Merged
jedcunningham merged 2 commits into
apache:mainfrom
astronomer:try-fix-flakey-log-message
Oct 4, 2022
Merged

Fix flakey test test_disable_logging#26871
jedcunningham merged 2 commits into
apache:mainfrom
astronomer:try-fix-flakey-log-message

Conversation

@dstandish

Copy link
Copy Markdown
Contributor

We expected an AssertionError arising from self.assertLogs, which means we expected that no logs would be emitted.

The problem is, when this fails, we don't know why -- we don't know what was logged that we did not expect to be logged.

We can improve this test by capturing the logs, then asserting that the logs captured are only the ones emitted explicitly in the test code (assertLogs will fail if we don't insert a dummy log record).

We expected an AssertionError arising from `self.assertLogs`, which means we expected that no logs would be emitted.

The problem is, when this fails, we don't know why -- we don't know what was logged that we did not expect to be logged.

We can improve this test by capturing the logs, then asserting that the logs captured are only the ones emitted explicitly in the test code (assertLogs will fail if we don't insert a dummy log record).
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Oct 4, 2022
Comment thread tests/providers/google/cloud/utils/test_credentials_provider.py Outdated
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants