chore(hosted_extractors): fix auto test cleanup with force=True#2584
Merged
Conversation
The jobs integration tests leak state between runs, causing 'external_id ... exists' setup errors across the full matrix. Module-level time-bound skip until the tests are fixed.
Merged
1 task
The previous commit skipped only test_jobs.py, but all four files in the directory fail setup due to the shared session-scoped cleanup fixture in conftest.py. Move the skip to a pytest_collection_modifyitems hook in that conftest so it applies to every test in the directory, and revert the file-level pytestmark in test_jobs.py.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2584 +/- ##
==========================================
- Coverage 92.79% 92.76% -0.04%
==========================================
Files 480 480
Lines 48446 48446
==========================================
- Hits 44956 44941 -15
- Misses 3490 3505 +15
🚀 New features to boost your workflow:
|
haakonvt
reviewed
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Using pytest_collection_modifyitems is a bit overkill here I would say:
pytestmark = pytest.mark.skipif(
date.today() < _SKIP_UNTIL,
reason=f"Hosted extractor integration tests are flaky; skip until {_SKIP_UNTIL.isoformat()}"
)
haakonvt
reviewed
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Another comment, based on the Slack feedback, https://cognitedata.slack.com/archives/C065WLH4G5N/p1776687620276759?thread_ts=1776677363.910429&cid=C065WLH4G5N , we should modify our test setup - the error message we suddenly started getting is the "correct" API response.
haakonvt
reviewed
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Base of stacked PR #2569.
Summary
Jobs with external_id:myJobForTesting-... exists for Sources, and 'enable_cascade' flag has not been set!across the entire OS/Python matrix.pytest.mark.skipifthat auto-reenables on 2026-05-04 so the flake does not permanently disappear.Test plan