Skip to content

chore(hosted_extractors): fix auto test cleanup with force=True#2584

Merged
haakonvt merged 5 commits into
masterfrom
fix/skip-flaky-hosted-extractor-jobs-tests
Apr 21, 2026
Merged

chore(hosted_extractors): fix auto test cleanup with force=True#2584
haakonvt merged 5 commits into
masterfrom
fix/skip-flaky-hosted-extractor-jobs-tests

Conversation

@ks93
Copy link
Copy Markdown
Contributor

@ks93 ks93 commented Apr 21, 2026

Note

Base of stacked PR #2569.

Summary

  • The hosted extractor jobs integration tests leak state between parallel runs, causing setup errors like Jobs with external_id:myJobForTesting-... exists for Sources, and 'enable_cascade' flag has not been set! across the entire OS/Python matrix.
  • Adds a module-level time-bound pytest.mark.skipif that auto-reenables on 2026-05-04 so the flake does not permanently disappear.

Test plan

  • pre-commit hooks pass
  • CI green on this PR (only unit tests exercise the file; skip is a no-op there)
  • After 2026-05-04 the skip expires automatically and tests run again

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.
@ks93 ks93 requested review from a team as code owners April 21, 2026 06:21
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request skips the flaky integration tests for hosted extractor jobs until May 4, 2026, by adding a pytestmark with a skipif condition. I have no feedback to provide.

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
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.76%. Comparing base (8760488) to head (f651587).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ration/test_api/test_hosted_extractors/conftest.py 0.00% 1 Missing ⚠️
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     
Files with missing lines Coverage Δ
...ration/test_api/test_hosted_extractors/conftest.py 91.11% <0.00%> (-4.45%) ⬇️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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()}"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did it myself 😉

Comment thread tests/tests_integration/test_api/test_hosted_extractors/conftest.py Outdated
@haakonvt haakonvt changed the title test(hosted_extractors): skip flaky jobs tests until 2026-05-04 chore(hosted_extractors): skip flaky jobs tests until 2026-05-04 Apr 21, 2026
@haakonvt haakonvt changed the title chore(hosted_extractors): skip flaky jobs tests until 2026-05-04 chore(hosted_extractors): fix auto test cleanup with force=True Apr 21, 2026
Copy link
Copy Markdown
Contributor

@haakonvt haakonvt left a comment

Choose a reason for hiding this comment

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

🦄

@haakonvt haakonvt enabled auto-merge April 21, 2026 18:56
Copy link
Copy Markdown
Contributor

@andersfylling andersfylling left a comment

Choose a reason for hiding this comment

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

🦄

@haakonvt haakonvt added this pull request to the merge queue Apr 21, 2026
Merged via the queue into master with commit ce76749 Apr 21, 2026
22 checks passed
@haakonvt haakonvt deleted the fix/skip-flaky-hosted-extractor-jobs-tests branch April 21, 2026 19:16
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.

3 participants