Skip to content

[DO NOT MERGE] ripple live test: failure modes and fallbacks - #344101

Closed
Alexandru Dima (alexdima) wants to merge 5 commits into
mainfrom
ripple-live-test/failure-modes
Closed

Alexandru Dima (alexdima) wants to merge 5 commits into
mainfrom
ripple-live-test/failure-modes

Conversation

@alexdima

Copy link
Copy Markdown
Member

Do not merge. Live CI experiment for #342907 (run only the unit tests a change can affect on macOS and Windows), experiment 2: failure modes and fallbacks.

What this shows

A broken ripple or configuration never fails silently, and never narrows testing:

  • the Ripple check goes red for pull requests that change build/ripple;
  • Detect Changes stays green: the planning steps continue on error, and its Check ripple step only warns;
  • macOS and Windows fall back to every unit test: there is no unit-test-plan artifact, so their unit test steps run without --runList, and their logs have no "Running the N ... test files of the M files listed in ..." line.

Each push changes one thing. Only Detect Changes, Ripple and the first minutes of the four macOS/Windows unit test jobs matter, so the rest of each run is cancelled once they have been observed.

Pushes and expected outcomes

Push Change Expected
1 ripple fails its own tests: remove the head-side dependent_tests(head, hg, &head_seeds, &mut sel.decl) call from select() in build/ripple/src/engine.rs. Locally, cargo test --release --locked fails 3 of 68 tests. Restore ripple misses the cache (its key hashes the Rust sources). Build ripple fails at cargo test, which leaves no target/release/ripple, so Plan unit tests fails. Check ripple warns. Detect Changes is green, Ripple is red, macOS and Windows run every unit test.
2 Revert push 1, and add an unknown field to build/ripple/vscode.jsonc (the configuration rejects unknown fields). Restore ripple restores the binary built on main (the configuration is not part of the cache key), Build ripple is skipped. Plan unit tests fails with invalid configuration build/ripple/vscode.jsonc, caused by unknown field `unknownFieldForLiveTest` . Check ripple warns. Detect Changes is green, Ripple is red, macOS and Windows run every unit test.
3 Revert everything under build/ripple, and add a comment to scripts/test.sh. Ripple is skipped: the pull request no longer changes build/ripple. The cached binary plans "running every unit test: test launcher (scripts/test.sh)" and uploads no plan. Check ripple does not warn. macOS and Windows run every unit test.

The results of each push will be posted as a comment.

What this cannot show live

That a ripple broken on main only warns on unrelated pull requests: their Ripple job is skipped, and nothing in Detect Changes fails. Showing that would need a broken ripple on main. build/lib/test/detectChanges.test.ts covers it ("the Ripple check runs for the pull requests that change ripple, and the planning never fails Detect Changes"): the Ripple job only runs when the pull request changes build/ripple, and every ripple and planning step of Detect Changes continues on error.

A finding from preparing push 1

The suggested way to break ripple, removing the base-side dependent_tests(base, bg, &base_seeds, &mut sel.decl) call, still passes all 68 of ripple's regression tests: none of them covers the traversal of the base commit's graph. Push 1 removes the head-side call instead.

How to test

For each push, look at the summary of Detect Changes and the annotation of its Check ripple step, the Ripple check, and the Download unit test plan step and first unit test step of macOS (run) / Electron-Unit, macOS (unit) / Browser, Windows (run) / Electron-Unit and Windows (unit) / Browser. To predict a plan locally: build/ripple/target/release/ripple plan --config build/ripple/vscode.jsonc --base origin/main --head HEAD.

Removes the head-side `dependent_tests` traversal from `select()` in
build/ripple/src/engine.rs, which 3 of ripple's 68 regression tests catch.
Live CI experiment, not to be merged.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 07:32

Copilot AI left a comment

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.

🔵 Needs a closer look

The experiment intentionally breaks test selection, is explicitly marked not to merge, and requires human confirmation of live CI fallback behavior.

No open issues 🎉

What changed in this PR

This do-not-merge experiment exercises the failure handling for ripple, the tool that selects affected macOS and Windows unit tests.

Changes:

  • Removes head-commit dependency traversal from test selection to intentionally trigger ripple regression-test failures.
  • Supports push 1’s validation of CI warnings and full-suite fallback; live CI results are not verified here.
File Description
build/​ripple/​src/​engine.rs Removes the head-side dependent_tests call while retaining base-side traversal.

Review effort: Balanced

Adds an unknown field to build/ripple/vscode.jsonc, which ripple rejects.
Live CI experiment, not to be merged.

Co-authored-by: Copilot <[email protected]>
This reverts commit 9554c83, so that this pull request no longer changes build/ripple.

Co-authored-by: Copilot <[email protected]>
Adds a comment to scripts/test.sh, a test launcher in ripple's
runEverything rules. Live CI experiment, not to be merged.

Co-authored-by: Copilot <[email protected]>
@alexdima

Copy link
Copy Markdown
Member Author

Results: failure modes and fallbacks

All three pushes behaved as expected. A broken ripple or configuration turned Ripple red while Detect Changes stayed green, and in all three pushes the macOS and Windows unit test jobs ran every unit test. I cancelled each run once the four macOS/Windows unit test jobs had been in their first unit test step for 2.5 to 4 minutes.

Push 1: ripple fails its own tests (run 40173132325, 5777549)

Step or check Expected Actual
Restore ripple cache miss ✅ Cache not found for input keys: ripple-Linux-0347550c…
Build ripple fails ✅ cargo test: 65 passed, 3 failed (data_folders_select_the_tests_that_name_them, deleted_and_renamed_tests_are_not_selected, object_methods_that_change_their_argument_write_it), exit code 101 after 54 s. Save ripple skipped.
Plan unit tests fails ✅ build/ripple/target/release/ripple: No such file or directory, exit code 127. No plan uploaded.
Check ripple warns ✅ "ripple failed to build, pass its tests or plan the unit tests, so macOS and Windows run every unit test."
Detect Changes green ✅ success in 1m12s
Ripple red ✅ failure: "This pull request changes build/ripple, and ripple failed to build, pass its tests or plan the unit tests."
macOS and Windows every unit test ✅ see the unit test jobs below

Push 2: invalid configuration (run 40173767525, 53ff94b reverts push 1, 9554c83)

Step or check Expected Actual
Restore ripple restores the binary built on main ✅ Cache hit for: ripple-Linux-c6f40f18…, the key saved on main by pr-ripple.yml. Build ripple skipped.
Plan unit tests fails on the configuration ✅ Error: invalid configuration build/ripple/vscode.jsonc, Caused by: unknown field `unknownFieldForLiveTest`, expected one of `modules`, … at line 9 column 26, exit code 1. No plan uploaded.
Check ripple warns ✅ the same warning
Detect Changes green ✅ success in 17 s
Ripple red ✅ failure with the same message
macOS and Windows every unit test ✅

Push 3: a run-everything rule (run 40174313894, 0c681c8 reverts push 2, 94c08fb)

Step or check Expected Actual
Restore ripple restores the binary built on main ✅ cache hit (same key). Build ripple skipped.
Plan unit tests every unit test: test launcher ✅ running every unit test: test launcher (scripts/test.sh). select=false, no plan uploaded.
Check ripple no warning ✅ no annotations (BUILD: skipped, PLAN: success)
Detect Changes green ✅ success in 22 s
Ripple skipped ✅ skipped: the pull request no longer changes build/ripple
macOS and Windows every unit test ✅

Unit test jobs

In every push, the Download unit test plan step of all four macOS/Windows jobs logged Found 0 artifact(s). Their unit test steps ran without --runList (./scripts/test.sh --tfs "Unit Tests" --rerun-failed-files 2, .\scripts\test.bat --tfs "Unit Tests" --rerun-failed-files 2, npm run test-browser-no-install -- --browser webkit --tfs "Browser Unit Tests" and node test/unit/browser/index.js --browser chromium --tfs "Browser Unit Tests"), and no log has a "Running the N ... test files of the M files listed in ..." line. No test failed on any OS before the cancellation.

The durations are the time until the cancellation took effect, not full runs:

Job Push 1 Push 2 Push 3
Linux (run) / Electron-Unit 5m18s 6m32s 6m33s
Linux (unit) / Browser 5m16s 6m32s 6m32s
macOS (run) / Electron-Unit 5m18s 6m33s 5m31s
macOS (unit) / Browser 5m22s 6m33s 6m32s
Windows (run) / Electron-Unit 5m15s 6m15s 6m15s
Windows (unit) / Browser 5m05s 5m13s 6m05s
Failed test files none none none

Findings

  1. No ripple regression test covers the base-side traversal. Push 1 was meant to remove dependent_tests(base, bg, &base_seeds, &mut sel.decl) from select(), but all 68 tests still pass without it, so push 1 removed the head-side call instead (3 tests catch that). The base-side traversal finds "the tests that depended on removed code" (the comment in select()). The two tests below pass on main but select nothing (left: []) without that call. Each covers a real way to break a test without changing it: removing an export, or a method, that an unchanged module still uses.

    Tests for mod tests in build/ripple/src/engine.rs
    #[test]
    fn removing_an_export_selects_the_tests_that_used_it() {
    	let mid = (
    		"src/app/mid.ts",
    		"import { a } from './lib.js';\nexport function g() { return a(); }\n",
    	);
    	let test = (
    		"src/app/test/g.test.ts",
    		"import { g } from '../mid.js';\ntest('g', () => g());\n",
    	);
    	let base = [
    		(
    			"src/app/lib.ts",
    			"export function a() { return 1; }\nexport function b() { return 2; }\n",
    		),
    		mid,
    		test,
    	];
    	let head = [("src/app/lib.ts", "export function b() { return 2; }\n"), mid, test];
    	assert_eq!(selected(&base, &head), vec!["src/app/test/g.test.ts"]);
    }
    
    #[test]
    fn removing_a_method_selects_the_tests_that_called_it() {
    	let mid = (
    		"src/app/mid.ts",
    		"import { C } from './lib.js';\nexport function g() { return new C().m(); }\n",
    	);
    	let test = (
    		"src/app/test/g.test.ts",
    		"import { g } from '../mid.js';\ntest('g', () => g());\n",
    	);
    	let base = [
    		(
    			"src/app/lib.ts",
    			"export class C {\n\tm() { return 1; }\n\tn() { return 2; }\n}\n",
    		),
    		mid,
    		test,
    	];
    	let head = [
    		("src/app/lib.ts", "export class C {\n\tn() { return 2; }\n}\n"),
    		mid,
    		test,
    	];
    	assert_eq!(selected(&base, &head), vec!["src/app/test/g.test.ts"]);
    }
  2. When planning fails, the Detect Changes summary has no plan line. ripple writes its "Unit test plan" summary only after a successful plan, and the workflow's own summary line comes after the ripple command, which stops the script under set -e. So in pushes 1 and 2, only the Check ripple warning annotation (and the red Ripple check, for pull requests that change ripple) shows that macOS and Windows run every unit test. If Check ripple also wrote "running every unit test: ripple failed" to $GITHUB_STEP_SUMMARY, the summary would always say what macOS and Windows run.

  3. A change to ripple's Rust sources adds a build to Detect Changes, and every test job waits for it. Here the build took 54 s, and Detect Changes took 1m12s instead of 17 to 22 s with a cache hit.

What this cannot show live

That a ripple broken on main only warns on unrelated pull requests. build/lib/test/detectChanges.test.ts covers this ("the Ripple check runs for the pull requests that change ripple, and the planning never fails Detect Changes").

This pull request stays open as a draft.

@alexdima

Copy link
Copy Markdown
Member Author

Experiment done: the results are in the comment above. Closing, as this pull request was never meant to be merged.

@alexdima
Alexandru Dima (alexdima) deleted the ripple-live-test/failure-modes branch October 25, 2026 08:12
Alexandru Dima (alexdima) added a commit that referenced this pull request Oct 25, 2026
No test covered the base-side traversal of `select()`, which finds the
tests that depended on removed code: every test passed without it.
Removing an export, or a method, that an unchanged module still uses
breaks the tests that load that module without changing them. Both new
tests select nothing (`left: []`) without that traversal.

From finding 1 of
#344101 (comment)

Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima) added a commit that referenced this pull request Oct 25, 2026
* ripple: count writes to pure globals as load-time effects

Changing a pure global or one of its members at load time, such as
`Error.stackTraceLimit = 0`, `console.log = f` or
`Object.defineProperty(Array.prototype, ...)`, changes what every module
that uses it does. ripple took it as having no effect outside the module,
because `escapes()` treats pure globals as local so that calling their
methods stays pure. A module that started loading such a module selected
none of the tests that load it.

Assignments, updates and `Object` mutators now escape when their target is
a global or a member of one, pure or not. Calls of their methods stay pure,
and changing what their methods return (`Object.create(proto)`) stays local.

Co-authored-by: Copilot <[email protected]>

* ripple: test that removing code selects the tests that used it

No test covered the base-side traversal of `select()`, which finds the
tests that depended on removed code: every test passed without it.
Removing an export, or a method, that an unchanged module still uses
breaks the tests that load that module without changing them. Both new
tests select nothing (`left: []`) without that traversal.

From finding 1 of
#344101 (comment)

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
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.

2 participants