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

fix(ingest): resolve issue with caplog and asyncio #9377

Merged
merged 2 commits into from Dec 5, 2023

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Dec 4, 2023

We're starting to see issues like this in CI, likely due to a dependency upgrade (probably freezegun https://pypi.org/project/freezegun/ - see discussion here spulec/freezegun#521)

When using caplog, we see a stray asyncio log message before the rest of the logs. This should clear that out.

FAILED tests/unit/api/source_helpers/test_source_helpers.py::test_auto_empty_dataset_usage_statistics - assert not [<LogRecord: asyncio, 10, /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/asyncio/selector_events.py, 58, "Using selector: %s">]
 +  where [<LogRecord: asyncio, 10, /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/asyncio/selector_events.py, 58, "Using selector: %s">] = <_pytest.logging.LogCaptureFixture object at 0x7f067d18d9d0>.records
FAILED tests/unit/api/source_helpers/test_source_helpers.py::test_auto_empty_dataset_usage_statistics_invalid_timestamp - assert 2 == 1
 +  where 2 = len([<LogRecord: asyncio, 10, /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/asyncio/selector_events.py, 58, "Using selector: %s">, <LogRecord: datahub.ingestion.api.source_helpers, 30, /home/runner/work/datahub/datahub/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py, 358, "1970-01-01 00:00:00+00:00">])
 +    where [<LogRecord: asyncio, 10, /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/asyncio/selector_events.py, 58, "Using selector: %s">, <LogRecord: datahub.ingestion.api.source_helpers, 30, /home/runner/work/datahub/datahub/metadata-ingestion/src/datahub/ingestion/api/source_helpers.py, 358, "1970-01-01 00:00:00+00:00">] = <_pytest.logging.LogCaptureFixture object at 0x7f0689f161d0>.records

Example failure: https://github.com/datahub-project/datahub/actions/runs/7084142887/job/19277839780

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@hsheth2 hsheth2 changed the title fix(ingest): resolve issue with caplog and async fix(ingest): resolve issue with caplog and asyncio Dec 4, 2023
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 4, 2023
Copy link
Collaborator

@asikowitz asikowitz left a comment

Choose a reason for hiding this comment

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

I made similar changes in one of my PRs. Think they're actually identical so hopefully no merge conflicts

@hsheth2 hsheth2 merged commit 7517c77 into datahub-project:master Dec 5, 2023
51 of 52 checks passed
@hsheth2 hsheth2 deleted the fix-caplog-async branch December 5, 2023 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants