Deflake CI: record DOI fixtures, retry Jupyter execution e2e tests - #62
Merged
Conversation
The two flake classes from #29: - DOI resolver tests no longer hit live doi.org: a mock session serves recorded content-negotiation responses (fixtures/doi.json), keeping the URL handling and BibTeX/CSL-JSON parsing under test while removing the dependency on doi.org availability/throttling. The live variants remain available behind TEST_LIVE_DOI=1 for fixture refresh / drift checks. 8 tests now run in ~30ms instead of ~4s. - The e2e export runner now supports per-case vitest `retry`; the two Jupyter kernel-timing cases (Serial/Concurrent execution) get retry: 2 with a fresh timeout per attempt. Deliberately not a workflow-level retry, so genuinely deterministic tests still fail fast and loudly. Fixes #29 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to deflake CI by removing reliance on live doi.org network calls in DOI resolver tests (using recorded fixtures) and by enabling targeted per-test retries for known flaky Jupyter execution end-to-end cases.
Changes:
- Add
retrysupport to the e2e test runner and setretry: 2for the two known flaky Jupyter execution cases inexports.yml. - Replace live-network doi.org test behavior with recorded fixtures, while keeping an opt-in mode for live DOI verification via
TEST_LIVE_DOI. - Add a changeset documenting the CI deflaking changes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mystmd/tests/exports.yml | Adds retry: 2 for the known flaky Serial/Concurrent Jupyter execution cases. |
| packages/mystmd/tests/endToEnd.spec.ts | Switches away from test.each to allow per-case vitest options (notably retries). |
| packages/myst-cli/src/transforms/fixtures/doi.json | Adds recorded doi.org responses used by the mocked DOI test session. |
| packages/myst-cli/src/transforms/doi.spec.ts | Introduces a mocked DOI session backed by fixtures and optional live-doi mode. |
| .changeset/ci-deflake.md | Records the deflaking change as a myst-cli patch changeset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mmcky
added a commit
that referenced
this pull request
Jun 12, 2026
Records squash commit e2bac52 as merged feature 12 (untagged, post-qe-v8) and adds a standalone upstream candidate — the deflaked tests are upstream's own and the touched files were byte-identical to upstream/main before the change. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #29
Context
Four flake incidents today alone, culminating in the live-DOI test failing all three node jobs simultaneously on the sync PR #59 (doi.org throttling the runner IP range). Of the issue's options this implements (4) the real fix for the DOI tests plus (2) targeted per-test retry for the Jupyter tests — deliberately not the workflow-level retry, so genuinely deterministic tests still fail fast.
DOI tests → recorded fixtures
doi.spec.tsnow uses a mock session whosefetchserves recorded doi.org content-negotiation responses (fixtures/doi.json, captured today with the properAcceptheaders — including themonth=Septquirk that previously caused live drift).URL), content negotiation by Accept header, and the full BibTeX/CSL-JSON parsing pipeline all still run — only the network is fixed.TEST_LIVE_DOI=1runs the same cases against live doi.org as well (16 tests total; verified passing) — for fixture refresh or upstream-drift checks, e.g. from a scheduled workflow later.Jupyter execution tests → targeted retry
endToEnd.spec.ts) moves fromtest.eachto per-casetest(title, { retry }, fn)so cases can declare vitest options;exports.ymlgainsretry: 2on exactly the two known-environmental cases (Serial execution,Concurrent execution), each attempt with a fresh timeout. All other e2e cases keepretry: 0.Testing
🤖 Generated with Claude Code