0.9.21: a leaner, faster test suite, the App tests in parallel lanes, and a clean quit noticed in seconds #264

Merged
ethan-hann merged 56 commits from integration-0921 into main 2026-10-27 23:43:42 -05:00
Owner

An audit of the 19,087-case suite found about 3,000 Core theory rows that asserted nothing, about 400 duplicated checks, render tests that only checked a file's size, fakes with no contract behind them, and a CI time dominated by about 970 slow cases and a small Windows CI VM (D70). This batch fixes that without changing product behavior beyond #255:

  • A new standard, .agents/coding-standards/tests-meaningful-and-fast.md (accepted), says every case must be able to fail, theory rows must reach their assertion, no duplicate coverage, honest fakes, cheap setups; remaining violations are #257-#261.
  • Template theories became loops that name every failing template (6,433 cases to 56); vacuous tests went; render-only tests run with SAVEPOINT_RENDER=1.
  • Slow Core classes build their git world once and copy it per test; UI sweeps share windows; three layout audits run on one render per state.
  • Fakes gained contract steps (app status, events, cancellation, process-name inputs, history after a capture), queued and background event delivery, a holdable or real dispatcher in the rigs, and a failure for any unanswered confirmation; real launch previews are fixtures.
  • The gate runs Core beside three App test lanes (build/app-test-lanes.txt) with a count check that no test method is dropped, live per-lane output with a heartbeat, one App process below 10 GB of free memory, Core at 4 to 8 threads, and Linux test temp folders on disk; the Windows CI job skips the format check the Linux job runs (owner's call). A stand-in dotnet in the gate tests no longer loops with the pwsh tool shim (it took a Linux VM down twice); a stale VM lock is broken (D60.6).
  • #255: a clean quit (exit code 0) of the game's program inside the relaunch window now ends the session about 4 s later instead of after the 2-minute grace (D13.10); #256 checks real store relaunches.

Reviewed by an Opus code review (0 critical; warnings fixed) and a gap analysis (doc gaps fixed). Follow-ups: #256-#263.

Local gates on d7d257c5: Windows gate passed (3666 App test methods in three lanes, count check matched; Core 11m06s, App lanes 2m56s to 5m26s); Linux gate on the VM passed (lanes, about 8.5 min in total).

Refs #255 (kept open until Balatro is retested)

An audit of the 19,087-case suite found about 3,000 Core theory rows that asserted nothing, about 400 duplicated checks, render tests that only checked a file's size, fakes with no contract behind them, and a CI time dominated by about 970 slow cases and a small Windows CI VM (D70). This batch fixes that without changing product behavior beyond #255: - A new standard, .agents/coding-standards/tests-meaningful-and-fast.md (accepted), says every case must be able to fail, theory rows must reach their assertion, no duplicate coverage, honest fakes, cheap setups; remaining violations are #257-#261. - Template theories became loops that name every failing template (6,433 cases to 56); vacuous tests went; render-only tests run with SAVEPOINT_RENDER=1. - Slow Core classes build their git world once and copy it per test; UI sweeps share windows; three layout audits run on one render per state. - Fakes gained contract steps (app status, events, cancellation, process-name inputs, history after a capture), queued and background event delivery, a holdable or real dispatcher in the rigs, and a failure for any unanswered confirmation; real launch previews are fixtures. - The gate runs Core beside three App test lanes (build/app-test-lanes.txt) with a count check that no test method is dropped, live per-lane output with a heartbeat, one App process below 10 GB of free memory, Core at 4 to 8 threads, and Linux test temp folders on disk; the Windows CI job skips the format check the Linux job runs (owner's call). A stand-in dotnet in the gate tests no longer loops with the pwsh tool shim (it took a Linux VM down twice); a stale VM lock is broken (D60.6). - #255: a clean quit (exit code 0) of the game's program inside the relaunch window now ends the session about 4 s later instead of after the 2-minute grace (D13.10); #256 checks real store relaunches. Reviewed by an Opus code review (0 critical; warnings fixed) and a gap analysis (doc gaps fixed). Follow-ups: #256-#263. Local gates on d7d257c5: Windows gate passed (3666 App test methods in three lanes, count check matched; Core 11m06s, App lanes 2m56s to 5m26s); Linux gate on the VM passed (lanes, about 8.5 min in total). Refs #255 (kept open until Balatro is retested)
An audit of the suite found about 3,000 theory rows that assert nothing, about 400 repeated checks, render tests that only measure a file, recorder-only assertions, fakes with no contract behind them, a harness that runs deferred UI work at once (it hid the #246 crash), and tests that rebuild a git world per test. New tests copy what they find, so the standard states each rule with a test to copy and one not to copy, and lists the known violations. It cites the existing test names and structure standard for templates and waits, and D60 for why no retry hides a slow test.
Each case rebuilt its two-profile repository (init, two saves, a branch, two switches). The seven worlds are now templates copied per case; the patterns go on after the copy. Same 41 cases, same assertions. Class time 79 s before, 49-72 s after under varying load. No red: a refactor of how the world is built.
The decision tree now walks every question, each rule names its exceptions, and every sub-rule has an example to avoid. The examples to copy now follow their own rules: a round trip through git for a value that passed through the product, a test that asserts the stored game and the toast, and loops with a guard on the data set. The verification greps match only render checks and the dispatchers that hold work back. Known violations are grouped by rule and say how an entry leaves the list. The full build-once-and-copy rule, with BackendWorkspace.CopyOf, now lives in the test names and structure standard, and this one points to it.
Each of the 10 cases built the three-folder game (add, create profile, two saves, continue), about 130 git processes. The world is now a template copied per case with BackendWorkspace.CopyOf, as RemovedWorld does. Same 10 cases and assertions. Class time 63 s before, 22 s after. No red: a refactor of how the world is built.
The three template classes ran one case per template (6,433 cases), and about
3,000 of those rows checked nothing because the template had no data for the
rule (1,595 mods rows for templates with no mods folder, and the saves, notes,
link and store rows for templates without that field). Several more repeated
another test: the path-token regex row in GameTemplatesTests restated
AssertResolves, the display-name row echoed the field the loader copies, and
Linux_and_macos_drafts_use_only_their_own_entry restated ToDraft 320 times.

Each per-template rule is now one method in TemplateRules that returns a
sentence per problem, and one test per rule runs it over every shipped
template and fails with every template id and reason. Saves and mods share the
same resolve, file-name, other-game and broad-folder rules. The id, display
name and install-folder checks fold into the valid-once-picked loop. A
synthetic fact keeps the per-system saves draft (linux, macos, windows) that the
320-row theory covered. TemplateRulesTests tries each rule on a template that
breaks it, so a loop cannot pass because a rule stopped finding anything.

Also removes PlaceholderTests (2 + 2) and CoreBackendTests.Every_api_is_present
(NotNull on non-nullable get-only properties the compiler already guarantees).

Observed reds (rule mutations, then restored): with six shipped templates
broken in memory-of-the-build (a mods path naming Cuphead, a non-digit GOG id,
a wrong steam link, a banned word in notes, a user-profile saves folder, a
.sav saves folder, a darwin key), each loop failed and listed the template,
for example "age-of-wonders-4: the GOG id '19154x' is not digits only". With
ToDraft's macOS key changed to linux, A_draft_uses_only_the_saves_folder_written_for_its_own_system
failed; with the broad-folder equality test forced false, TemplateRulesTests
saves and mods facts failed.

Case counts: ShippedTemplatesTests 3527 -> 18, ModsFolderTemplateTests
1609 -> 13, GameTemplatesTests 1297 -> 19, TemplateRulesTests 0 -> 6,
CoreBackendTests 10 -> 9, PlaceholderTests 1 -> 0.
The real dispatcher runs Post at once on the UI thread and queues it from other threads, and always queues PostWhenIdle. The standard said the app never runs a post inline, which a reader of IUiDispatcher would catch. A picture test's skip goes in build/expected-skips because the gate fails on any skip its list does not name.
17 of 24 cases added a game and captured a profile before the move under test. The seeded folders are now a template copied with BackendWorkspace.CopyOf, and each case's backend runs its startup check once before the test body, as the seeding did. Same 24 cases and assertions. Class time 37 s before, 14 s after. No red: a refactor of how the world is built.
LaunchRig.FromWorldAsync now rents a copy of any named world, not only the two-profile one (TwoProfileTemplates keeps a free list per world). LaunchUpdateExistingTests builds its Vanilla, Vanilla+Heavy, Heavy-with-its-own-snapshot and Original+Copy worlds once and copies them; 18 of its 19 cases start from a copy. Same 19 cases and assertions. Class time 95 s before, 46-55 s after. No red: a refactor of how the world is built.
Each (layout, screen) now runs the toasts-only sweep in one window and the pill, pill-with-toasts and
full-height-stack configurations in a second one, instead of a window per configuration. The pill and
toast overlap checks of the old per-size test run in the pill-with-toasts configuration on every screen.
The five job pill PNG renders move behind SAVEPOINT_RENDER=1 and lose the file-size assertion.

Spike: fresh windows and shared windows gave identical bounds, scroll extents and offsets on every
screen except the History lists, whose later audits see the exact extent of a virtualized list.
JobPillPlacementTests 123 cases/97.5 s -> 29 cases (28 + 1 on-demand)/55.7 s.
The footer clearance and dark focus ring checks now run per dialog state: the standard, 200% and 150% sizes
share a window (they only shrink) and the 800x560 size gets a fresh one. The light theme ring check stays
a separate case for the states seen in both themes. The two unasserted PNG writes go behind SAVEPOINT_RENDER=1.
Mutation check: a 260 px required gap and an always-failing ring pixel test failed every state at all four
sizes (footer) and at both ring sizes in both themes, naming state, size and button.
DialogFooterClearanceTests 157 cases/54.5 s -> 37 cases/32.9 s.
LaunchLinesTests: the job-names-its-profile case now asserts inside the switch-lines case (same two-profile rig, same start of Vanilla). JobLinesHideEngineFoldersTests: the move-reports-each-folder case now asserts inside the no-file-path case (same game, same move). Every assertion is kept. 6 cases to 5 in each class. No red: a refactor of how the tests are arranged.
HorizontalOverflowAuditTests and AccessibilityAuditTests opened the same 62 states and 23 dialog states that
AppStateAuditTests opens. Its single visit now also runs the sideways audit at the two scaled sizes and the
640x420 window, and the dialog description check on the dialog states. Each problem line names its audit,
the size and the state. Mutation check: inverting the dialog title comparison failed exactly the 23 dialog
states with the screen reader description line. AppStateAuditTests+HorizontalOverflowAuditTests+AccessibilityAuditTests
147 cases/55.8 s -> 62 cases/23.3 s.
The back-arrow check and the card-order check each opened the editor and tabbed all the way round; both
assertions now run on one walk of 100 stops. TabOrderTests 14 cases/39.5 s -> 13 cases/34.8 s.
BackendWorkspace.FromWorldAsync builds a named world once and hands each caller a copy, for classes that start from a game with a taken profile. ModsHistoryTests uses it for its three-folder game with a Vanilla profile (11 of 16 cases). Same 16 cases and assertions. Class time 33-57 s before, 26-48 s after on a loaded machine (median 45 s to 29 s). No red: a refactor of how the world is built.
The render classes for Games, Help, game editor, launch, History, Settings, Shell, Library and the final
screens asserted only that a PNG was over 10 KB, which a blank or mis-laid-out frame also passes. Each is
now one on-demand test that writes its pictures when SAVEPOINT_RENDER=1 (skipped otherwise, listed in the
expected-skips files), as DocScreenshotTests does for docs/images. The unasserted PNG writes in the reflow,
games header, toast placement, library error, checking card, loading and artwork tests go behind the same
variable; the layout and artwork assertions in those tests stay.
New contract steps run against both backends and the fake is fixed where they differed.

Contract steps added:
- AppStatusContractTests: CheckAsync on a healthy, corrupt and moved storage folder, recovery of catalog files, UseStorageFolder and StartWithEmptyStorage.
- BackendContractTests: the job and session event streams (states in order, revisions rising, last event equals the final state), a cancelled token on 24 reads, program names and program lists, history and row stats after saves.

Observed reds (assertion failures, fake vs real):
- AppStatusContractTests.The_real_startup_checks_...: fake "first check: ...; storage not checked" vs real "storage reachable=True at the default folder"; fake "use a folder while the storage is reachable: error.storage.noHistoryHere" vs real "error.storage.stillReachable"; fake "start empty while the storage is reachable: taken" vs real "stillReachable"; settings root unchanged in the fake after UseStorageFolder.
- BackendContractTests.The_real_backend_sends_the_same_job_and_session_events_...: "Compact of alpha-1: Running > Cancelled" only in the real backend, and the real session passes through Switching (both now pinned as gaps).
- BackendContractTests.The_real_backend_tells_the_same_first_run_story_as_the_fake: "program suggested for a folder named after one of two equal programs: alpha.exe" (fake) vs "zebraquest.exe" (real); "history after the first save: 0 points" vs "1 points"; row stats "active=False snapshots=0" vs "active=True snapshots=1"; history order for points saved at one instant.
- Cancellation and program size steps passed on first run and were mutation checked: disabling the token check, and a constant program size, each fail the contract with the differing lines.

Fake fixes: tokens already cancelled fail with error.operation.cancelled before any work, any exception becomes the result's error, startup storage is only checked when git runs and the catalog reads, the two storage choices refuse while the folder is reachable and set the settings' folder, a moved-aside catalog file is stamped, program suggestions get the folder name, folder and real file sizes, a finished capture adds its point and makes its profile the loaded one, newest point first on ties.

Harness: FakeBackend.Delivery (Inline, Queued, Background) with DeliverQueuedEvents and WhenEventsDeliveredAsync, tested in FakeEventDeliveryTests (reds: events seen before DeliverQueuedEvents, on the calling thread, before the call returned).
ManualDispatcher moves to Fakes/ and gains RunAll. EditorRig, HistoryRig, LaunchRig, SettingsRig, GamesViewHarness, LaunchViewHarness and ShellViewHarness take an optional dispatcher the way ActivityRig, GamesRig, ShellRig and ScreenHarness already did.

New tests (real dispatcher, fake events delivered in the background after the call returned, then the screen is used):
- ActivityScreenOffThreadEventsTests: a click in the task list after jobs finished off-thread.
- GamesScreenOffThreadEventsTests, HistoryScreenOffThreadEventsTests, SettingsScreenOffThreadEventsTests, LaunchFlowOffThreadEventsTests.

No red was observable for these: each passed on its first run, so each was mutation checked against the product code:
- Activity: PostWhenIdle replaced by Post in the selection handler fails with ArgumentOutOfRangeException (Index was out of range), the original crash.
- Settings: dropping Storage.Handle(job) fails "Assert.True() Failure" (the row never shows the run).
- History: making ReloadIfShown do nothing fails "Assert.True() Failure" (the ninth snapshot never joins the header).
- Games: dropping RefreshPlayAvailability from the job handler fails "Assert.True() Failure" (rows never become busy).
- Launch: ignoring the Exited session event fails "Assert.True() Failure" (no post-play dialog).
A first Activity version without pointer input passed the same mutation, so it was rewritten to click in the list.
The App UI tests share one headless UI thread per process, so one process ran them one at a time. The gates now start the Core tests
and three App test processes at once: one per line of build/app-test-lanes.txt (EndToEnd and its RealBackend journeys) and a "rest"
process that excludes those namespaces, so every test is in exactly one process and a namespace added later lands in "rest".
--filter-namespace and --filter-not-namespace match a namespace exactly, which the lane file's comment and the tests state.

A listing taken before the run and the reports after it must agree: build/check-test-counts.ps1 and .sh compare the distinct test
methods of the three reports with the distinct methods of dotnet test --list-tests, and fail the gate on any difference. Methods are
counted, not cases, because a theory with data that cannot be listed shows once in the listing and once per row in a report (found:
AppBootstrapTests.A_backend_that_cannot_start_becomes_an_api_that_reports_why lists 1 case and runs 7, so the listed total and the
run total differ by design). A run with SAVEPOINT_TEST_ARGS that narrows still runs the two modules whole, as before. Reports go to
one folder under their own names, so the skip check reads all of them. D60 stands: no retries; priority, the gate lock and thread
caps are unchanged (Core 4 threads, each App process 2).

gate.ps1 takes -SkipFormat; the Windows CI job passes it, the Linux job and the local gates still run dotnet format.

Tests first, observed:
- GateWorkflowTests.The_windows_job_leaves_out_the_format_check_and_the_linux_job_keeps_it: red with "Pattern not found in value,
  Regex: (?m)^\s*\./build/gate\.ps1 -SkipFormat\s*$" before the workflow change.
- New AppTestLanesTests, GateSplitTests (copies of the gate scripts against a stand-in dotnet) and ScriptProcess helper passed on their
  first run, so each got a mutation check: count check made one-sided (-gt) failed the fewer-tests cases of both scripts; counting
  cases instead of methods failed the pass and mismatch cases of both scripts; removing the count check from either gate failed the
  pass and mismatch cases; a rest filter naming only the first lane failed "Expected [EndToEnd, EndToEnd.RealBackend], Actual
  [EndToEnd]" for both gates; forcing the format step on failed the -SkipFormat case.
Msys2SourcesScriptTests started one pwsh per theory row (21 starts). The rows of its three theories are now one table each, their
probes run in one pwsh start for the class (a row that throws leaves its error as its output, so only its own test fails), and each
row's test asserts the same things on its slice. The facts keep one start each.

StorageGateTests.Shared_holders_run_side_by_side asserted nothing. It now holds one shared lease and requires a second to get in within
10 seconds. It passed on its first run, so it got a mutation check: a shared enter that waits while another shared holder is inside
failed with "System.TimeoutException : The operation has timed out." Changing one Msys2 row's expected source made only that row fail.
A confirmation with no queued answer used to be accepted, so a destructive question passed whether or not the test said yes. FakeDialogs.DefaultConfirmAnswer is now null, and a confirmation with no queued answer and no default throws a test failure that names the question.

Red: FakeDialogsTests.A_confirmation_with_no_answer_queued_fails_the_test_instead_of_being_accepted failed with "Assert.Throws() Failure: No exception was thrown".

Tests that relied on the silent yes now say what they mean: eight methods (12 cases) in GamesScreenActionsTests (delete a profile or a game; yes where the delete is checked, no where only the question's words are), and one each in StartupViewModelTests, PostPlayDialogViewModelTests, LaunchDialogViewModelTests, LaunchSteamFlowTests, StorageSectionViewModelTests and LibraryRunExitTests, plus two in GameEditorFolderMismatchTests, one of which now also checks that nothing is saved until the answer is yes (its name said so, but it never answered).
Deleted (coverage in brackets):
- Theme/Material/ReadmeTableTests, 2 methods and 29 cases (28 role values and the agreeing-cells fact): every one of the 28 values is in the tonalSpot-blue-dark-c0 and tonalSpot-blue-light-c0 rows of golden-mcu-0.3.0.json, which Md3PaletteGoldenTests compares for all roles. The blue seed constant moved into Md3PaletteTests.
- SampleScenarioTests, 10 of 12 (rail, profile table, storage, history list, history filter, two launch previews, wizard preview, editor folders, settings): they asserted the design fixture against itself; the Games, History, Launch, Editor and Settings tests read the same values through the screens, and the history filter is a contract step.
- FakeAppStatusApiTests, 3 of 4 (folder with no history refused, folder with history taken, empty start in a free default folder): AppStatusContractTests compares them with the real checks.
- FakeModsFolderTests, 1 of 4 (three folders in order): the contract's folder status of a mods game.
- FakeCallLogTests, 2 of 8 (arguments recorded, Clear): every screen test that reads Args or Clear depends on them.
- OperationResultTests, 8, moved to tests/Savepoint.Core.Tests/Api because they test a Core type (8 pass there).

Rewritten to assert what the player sees instead of a recorded call: the shell's footer sizes after a finished optimization, a launch job and a running snapshot job not refreshing the cards, the Clear all data dialog worded from the preview, the library scan changing nothing, and the three "choosing what is already chosen saves nothing" tests, which now also check the stored setting and the control.

Mutation checks (each failed as expected, then restored): the shell keeping its first sizes (A_finished_optimization_updates_the_sizes: Expected end "12.3 GB"); the shell refreshing on every non-capture job (three shell tests failed); the dialog counting 0 bytes (The_button_reads_what_would_go_before_it_asks_anything failed).
LaunchPreviewFixtures writes a real LaunchPreview as JSON with the run's names and paths swapped for tokens, and reads it back with the fake run's names. Three previews the real backend gave in the contract story are kept in tests/Savepoint.App.Tests/Fakes/Previews: a profile whose folders hold it, a folder a stopped switch left half done, and the same folder once the switch was finished. FakeContractHarness plays those back where it used to build the first by hand and rewrite it by hand for the other two.

Red: BackendContractTests.The_launch_previews_the_fake_plays_back_are_the_ones_the_real_backend_gave failed with "The preview 'profile-tip-clean' has no file" before the files were captured (SAVEPOINT_CAPTURE_PREVIEWS=1 writes them from the real run). Mutation check: setting ShowBanner to false in profile-tip-clean.json fails that test (Expected "ShowBanner": false, Actual "ShowBanner": true) and the shared story test.
Red observed (ArtworkContractTests.The_real_backend_tells_the_same_artwork_story_as_the_fake, run twice): 'fake: events after choosing: 0 / real: events after choosing: 1', and on the second run also 'events after removing: 1 vs 2'. The fake delivers events on a pool thread, so the story counted them before they arrived.

The harness gets EventsDeliveredAsync (a no-op for the real backend, WhenEventsDeliveredAsync for the fake) and the story awaits it before every count. The other Contract classes (backend and app status stories) read events only through ContractEvents, which already waits for the newest state, and passed unchanged.
Reds observed (GateSplitTests, assertion failures): With_too_little_free_memory... 'Expected: app / Actual: app-endtoend'; One_lane_override... same; With_exactly_enough... and A_lanes_override... 'Sub-string not found' (no mode line in the gate output); A_lanes_setting_the_gate_does_not_know... 'Expected: Not 0 / Actual: 0'; The_linux_gate_runs_every_test_process_with_its_temp_folder... 'Assert.All: 4 out of 4 items did not pass'.

Both gates read available memory (Windows performance counter, /proc/meminfo MemAvailable, vm_stat) after the lock is held; below 10240 MB the App tests run as one process named app, otherwise in the lanes, and the gate says which and why. SAVEPOINT_GATE_APP_LANES=1 or 3 overrides it, an unknown value is refused before the build, and SAVEPOINT_GATE_AVAILABLE_MEMORY_MB replaces the reading. The count check reads app.xunit alone in one-process mode. Core's default threads are a third of the logical processors, clamped to 4..8 (it was 4 and the longest process); the lanes keep 2. gate.sh makes a fresh artifacts/tmp inside the tree and gives it to the test processes as TMPDIR, TMP and TEMP, removing it at the end. gate-linux passes SAVEPOINT_GATE_APP_LANES on to the VM.

Mutation check: a thread cap of 12 in gate.sh made By_default_core_gets_at_least_four_threads... fail with 'Value not in range, Range: (4 - 8), Actual: 10'.
Reds observed (GateSplitTests): Each_test_process_prints_its_output_under_its_own_name... 'Sub-string not found' for '[core] output of core, first line' in both gates; The_listing_counts_two_methods_whose_names_differ_only_in_case_as_two (PowerShell) 'test count check failed: the test processes ran 2 + 2 + 3 = 7 test methods, but the full listing has 6' (the Bash gate already counted 7 and stays as a guard). VM lock: run against the old vm-common.sh with a program holding the lock file and a note naming a finished run, vm_take_heavy_lock refused with exit 75 and never printed 'taken' (VmLockTests.A_program_a_killed_run_left_holding_the_lock_is_ended_and_the_next_run_goes_ahead; checked in Ubuntu under WSL, the tests skip on Windows).

Both gates print each test line at once with the process name in front, and say every SAVEPOINT_GATE_HEARTBEAT_SECONDS (300) which processes are still running; the Linux CI job shows this in its log. The Windows listing count uses Sort-Object -Unique -CaseSensitive and the bash counts use LC_ALL=C. vm-common.sh gains vm_holder_is_stale (no note, dead process, or a note older than the boot) and vm_free_stale_lock, which ends programs still holding a lock whose note is stale twice in a row; the gate, package and heavy locks use it.
The saves and mods rules looped over parts of the shipped data that only some templates carry, and the one count guarding them was met by the Windows saves folders alone. A new count checks each system's saves and mods folders, the per-system entries, the store names, the notes and the link launches. The check over the shipped templates now has a test that can fail, a rule that throws on one template is reported for that template instead of ending the loop, and the SavesByOs and ModsByOs branches have a case that feeds them to the rules.

Observed with the code broken on purpose:
- SavesPaths without its SavesByOs branch: ShippedTemplatesTests.The_data_each_rule_loops_over_is_there_in_every_part_the_rules_check failed with "Linux saves folders: 0, expected at least 40" and "macOS saves folders: 0, expected at least 60"; TemplateRulesTests.The_per_system_folders_of_a_template_reach_the_saves_and_mods_rules_under_their_own_system failed with Expected [("linux", ...)] Actual [].
- AssertShippedTemplatesKeep with problems.Count >= 0: The_check_over_the_shipped_templates_fails_when_a_rule_finds_a_problem failed with "No exception was thrown".
- ProblemsIn without the catch: A_rule_that_throws_on_one_template_is_reported_and_the_templates_after_it_are_still_checked failed with the rule's own exception escaping.
Observed reds before the fix:
- GameSessionWatcherTests.A_program_seen_under_its_name_that_quits_cleanly_inside_the_relaunch_window_ends_the_session_after_the_relaunch_guard: Assert.True failed, "a clean quit waited out the whole grace"
- LaunchSteamTests.A_Steam_game_started_after_Start_Steam_and_quit_a_few_seconds_in_offers_the_after_play_choices_without_Im_done: TimeoutException, the session never reached Exited after Preparing, Switching, Running (the game had quit; the watcher waited out the grace)

The other two new watcher tests pass on the current code and pin what must stay (a copy started within the guard is followed; an error exit keeps the whole grace).
The History render test was the only gate-run test that built BringBackDialogView, and it now runs only on request. A history-bring-back state in AppStates puts the dialog through the naming, description, footer, keyboard and sideways audits again.

FakeDialogs now records each confirmation nobody answered, and an assembly-level check fails the test that built the fake when the record is not empty at the end. The throw alone lands in the command's task, which about fifty call sites drop. The check was tried on a plain and a headless test that start a command and drop its task: both failed with "The screen asked ... and the test queued no answer". The App namespaces that use FakeDialogs all pass with it, so no test needed a changed answer.

Observed with the view broken on purpose: removing the name field's accessible name from BringBackDialogView.axaml made AppStateAuditTests (state "history-bring-back") fail with "[screen reader name] TextBox #NameField [] has no accessible name".
A started program that was listed under its configured name and exits with code 0 inside the relaunch window was held for the whole grace, so a player who quit Balatro 17 s in had to press I'm done. Such an exit now waits only two polling intervals, the look that would list a copy a store started at once; an error exit keeps the whole grace, and a copy that shows up in the guard is still followed. The session end log line now says the program's exit code.

Observed reds before the log change:
- LaunchActionLogTests.A_session_that_ends_after_the_started_program_exited_logs_the_programs_exit_code: Assert.Contains failed, Not found: the program exited with code 3

Existing watcher tests that left the exit code at its default 0 while pinning the relaunch grace now exit with code 1, which is the case that grace is for.

Mutation checks: matching any exit code instead of 0 failed four grace tests; a zero guard failed the clean-quit tests and the copy-within-the-guard test.
The cancelled-read contract story left out IArtworkApi.GetAsync and IGamesApi.ImportDefinitionAsync, so the fake answered success to a cancelled artwork read where the real backend answers error.operation.cancelled. Both are in the story now (26 lines), named by the proof test, and the fake passes the token.

The scan test that is named "one read" and the clear-all-data preview test again check how many times the read happened, beside the visible results they check now.

Observed reds:
- BackendContractTests.The_shared_story_answers_every_read_given_a_cancelled_token_with_the_cancelled_error failed with "artwork with a cancelled token: success" not ending in the cancelled error, and The_real_backend_tells_the_same_first_run_story_as_the_fake with fake "success" against real "error error.operation.cancelled".
- The import line passed on its first run; with FakeGamesApi.ImportDefinitionAsync not passing its token, both tests failed with fake "error error.unknown" against real "error error.operation.cancelled".
- With the screen reading twice on purpose: ClearAllDataTests.The_button_reads_what_would_go_before_it_asks_anything failed with "Assert.Single() Failure: The collection contained 2 items", and LibraryPickerDialogViewModelTests.The_scan_is_one_read_that_changes_nothing failed with ["ScanLibrariesAsync"] against ["ScanLibrariesAsync", "ScanLibrariesAsync"].
- The editor tab-order check uses the default limit of 60 stops again (it passes within it), and the failure says that either focus escapes or the screen outgrew the limit.
- A pill sweep that cannot finish is reported as a problem beside the other sweep's problems, instead of hiding them. Tried by making the pill setup fail: the failure read "[with the job] the sweep stopped: TrueException: The job pill is not up."
- The two-profile world deletes the ready file its building play left, so a copy does not look like it has a running game. TwoProfileTemplatesTests.A_copy_does_not_start_with_the_ready_file_of_the_game_that_built_its_world failed first with "A test that waits for the game would take the file left by the build for a game that is running."
- RepoTemplates drops a failed or cancelled build and disposes its workspace, so the next test builds it again. RepoTemplatesTests.A_template_whose_build_failed_is_built_again_for_the_next_test failed first with the first build's InvalidOperationException rethrown; A_template_that_built_is_not_built_again passed first and failed with "Expected: 1 Actual: 2" when the cache was bypassed.
- The legacy-data and mods free-up-space templates register their delete at exit before the part that can fail, and dispose the workspace when it fails.
- GamesRig and ShellRig give their toasts, and ScreenHarness gives the startup screen, the dispatcher the rig was given.
The standard is accepted (the owner asked for it). The known-violations list keeps only what is still true: the file-only render checks left in gate tests, the golden theories, the EstimatesStoppedAtRunStart flag, ComposedApp's instant dispatcher, and the fake tests that only echo input. The cloud-saves overload, ManualDispatcher and audit method citations match the code, a loop guard now counts each part of a data set, and unanswered-question recording is a fourth rule for fakes.
A PowerShell installed as a .NET tool is a shim that starts "dotnet <folder>/pwsh.dll" through PATH. GateSplitTests puts a stand-in dotnet first on PATH, and the stand-in ran pwsh, so on a machine with that shim (the Linux test VM, the Linux CI job) every start of pwsh started the stand-in, which started pwsh again, without end. The VM ran out of memory twice (1054 and 8349 pwsh processes in the kernel's OOM dumps). Steam was a bystander: it had been running since Oct 25.

The stand-in now hands a start of pwsh.dll to the real dotnet, and refuses to start itself more than three times in a row.

Observed reds, with the old stand-in:
- GateSplitTests.The_stand_in_dotnet_hands_a_start_of_pwsh_dll_to_the_real_dotnet_and_runs_nothing_of_its_own: "The real dotnet was never started."
- GateSplitTests.The_stand_in_dotnet_stops_when_it_has_been_started_from_itself_too_many_times_in_a_row: Assert.Equal 97, actual 0.
On the Linux VM gate An_index_that_cannot_be_read_is_listed_by_git failed in the full Core run (never in a class run): 'Assert.Contains() Failure: Filter not matched in collection', the four recorded git calls holding no ls-files -t. A diagnostic run showed the index cut to 313 bytes was 626 bytes again after GetStatusAsync alone (two read-only git calls, no repair): git diff writes back a whole index over stale stamps, and the copied world has stale stamps. The reader then proved the rewritten index mark-free and git was never asked. The save now runs first, on the index as cut; the status call follows. The assertion is unchanged.
A store's relaunch stub exits at once with code 0 and the store starts the game again a little later. The clean-quit shortcut (two process-list looks) ended that session before the new copy appeared. The shortcut now needs the started program to have run at least GameSessionOptions.CleanQuitMinimumRun (default 10 s) before it exited with code 0; an earlier clean exit and any error exit keep the whole grace.

Why 10 s: a stub exits within about a second (its own startup check), the real-process relaunch test exits after 0.6 s, and a player needs longer than that to get past splash screens and quit; the Balatro quit that motivated the shortcut was 17 s.

Observed reds:
- GameSessionWatcherTests.A_program_seen_under_its_name_that_exits_cleanly_before_the_minimum_run_keeps_the_grace_and_follows_the_copy_started_later: Assert.False failed, "a stub that exits at once is not a player who quit".
- RealSessionTests.A_game_that_exits_at_once_and_is_started_again_by_another_program_is_followed_to_the_end_of_the_new_copy did not fail locally (passed twice; it needs the watcher to list the stub under its name before the 0.6 s exit, which depends on timing). The watcher test above is the deterministic red for the same behavior.
- LaunchSteamTests.A_Steam_game_started_after_Start_Steam_and_quit_a_few_seconds_in_offers_the_after_play_choices_without_Im_done failed after the rule change (its stand-in quits after 1.5 s); it now sets CleanQuitMinimumRun to 1 s.

Mutation check: changing >= to > on the minimum failed the 10 s row of the clean-quit theory.
Record that only a clean quit after 10 seconds of play ends the session early (D13.10, D48)
Some checks failed
Docs / site (pull_request) Successful in 1m26s
Gate / linux (pull_request) Successful in 17m7s
Gate / windows (pull_request) Successful in 31m51s
Release / windows (push) Failing after 31s
Docs / site (push) Successful in 1m21s
Release / linux (push) Failing after 43s
Release / checksums (push) Has been skipped
d7d257c5b2
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint!264
No description provided.