From 3ebc10f95fb8e4b2235dbfa65df309d7da4687cc Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 05:25:57 -0700 Subject: [PATCH 1/7] test(ci): fold strictly-accounted suites into broad shards --- tests/test_ci_cmux_unit_test_shard.py | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_ci_cmux_unit_test_shard.py b/tests/test_ci_cmux_unit_test_shard.py index 26e1e2d0ef8d..b77aa3cc5fcd 100644 --- a/tests/test_ci_cmux_unit_test_shard.py +++ b/tests/test_ci_cmux_unit_test_shard.py @@ -391,6 +391,32 @@ def focused_steps_in_ci_workflow() -> tuple[set[str], set[str], dict[str, str]]: return whole, partial, env +def check_truthful_broad_suites_leave_focused_gates() -> int: + """Suites protected by strict broad accounting should run in the timed batch.""" + import importlib.util + + folded = { + "CloudNotificationDismissParityTests", + "AgentRestoreLiveOwnerAdmissionTests", + "GhosttyOptionAsAltModsTests", + "CLISSHSessionAttachAnchorTests", + } + spec = importlib.util.spec_from_file_location("cmux_unit_test_shard_folded", HELPER) + assert spec is not None and spec.loader is not None + helper = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = helper + spec.loader.exec_module(helper) + + focused = {selector.split("/", 1)[1] for selector in helper.FOCUSED_GATE_SELECTORS} + whole, _, _ = focused_steps_in_ci_workflow() + stale = sorted(folded & (focused | whole)) + if stale: + print(f"FAIL: truthful broad suites still have dedicated focused ownership: {stale}") + return 1 + print("PASS: truthful broad suites are owned by the measured shard batch") + return 0 + + def check_focused_gates_run_once() -> int: import importlib.util import re @@ -585,6 +611,9 @@ def main() -> int: if (rc := check_reserved_workers_get_less_of_the_batch()) != 0: return rc + if (rc := check_truthful_broad_suites_leave_focused_gates()) != 0: + return rc + if (rc := check_focused_gates_run_once()) != 0: return rc From 56e2e6b6f1e69fbd204df56bebd8d0025659f4ad Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 05:26:59 -0700 Subject: [PATCH 2/7] ci: return strictly-accounted suites to timed shards --- scripts/ci/cmux_unit_test_shard.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/ci/cmux_unit_test_shard.py b/scripts/ci/cmux_unit_test_shard.py index 3503245e781d..4bf8305e9bc4 100755 --- a/scripts/ci/cmux_unit_test_shard.py +++ b/scripts/ci/cmux_unit_test_shard.py @@ -42,13 +42,11 @@ "cmuxTests/AgentChatSessionRegistryLifecycleReviewRegressionTests", "cmuxTests/AgentJournalLifecycleCenterTests", "cmuxTests/AgentNotificationRegressionTests", - "cmuxTests/AgentRestoreLiveOwnerAdmissionTests", "cmuxTests/BackgroundPrimeStartableSurfaceTests", "cmuxTests/BrowserOmnibarSuggestionClickRoutingTests", "cmuxTests/BrowserPanelViewIdentityTests", "cmuxTests/BrowserSystemProxyMirrorTests", "cmuxTests/BrowserViewportRuntimeTests", - "cmuxTests/CLISSHSessionAttachAnchorTests", "cmuxTests/CLISendQueuedOutputTests", "cmuxTests/ClaudeBackgroundWorkNotifyTests", "cmuxTests/ClaudeHookLifecycleCleanupTests", @@ -56,7 +54,6 @@ "cmuxTests/ClaudeHookPIDAuthenticationTests", "cmuxTests/CloudMachineDragSourceTests", "cmuxTests/CloudMachineOrderingTests", - "cmuxTests/CloudNotificationDismissParityTests", "cmuxTests/CloudWorkspaceRenameSurfaceParityTests", "cmuxTests/CmuxBundledBinPathIntegrationTests", "cmuxTests/DeviceDirectoryLifecycleTests", @@ -73,7 +70,6 @@ "cmuxTests/FeedCoordinatorTests", "cmuxTests/FeedWaiterRegistryTests", "cmuxTests/GhosttyNumericLocaleTests", - "cmuxTests/GhosttyOptionAsAltModsTests", "cmuxTests/GhosttyTerminalViewVisibilityPolicyTests", "cmuxTests/GlobalSearchShortcutBehaviorTests", "cmuxTests/HostSettingsShortcutNotificationTests", From bb9fbd2d8092c4daea7835400f23848a6de552f4 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 05:27:11 -0700 Subject: [PATCH 3/7] ci: fold obsolete focused gates into broad shard batches --- .github/workflows/ci.yml | 68 +--------------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a46595de0fb4..e0c82209b3eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -990,7 +990,7 @@ jobs: CMUX_APP_HOST_CLI_REGRESSION_SHARD: "4" CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD: "5" CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD: "6" - CMUX_APP_HOST_RESERVED_WALL_SECONDS: "1=474 4=235 5=245 6=284" + CMUX_APP_HOST_RESERVED_WALL_SECONDS: "1=474 4=235 5=199 6=284" # Four-way packing now exceeds the app-host's memory budget as the suite # grows: a shard can crash around 1,000 UI tests and poison the remaining # selectors. Six-way packing keeps each broad shard near 13 minutes of @@ -1575,72 +1575,6 @@ jobs: -only-testing:cmuxTests/BrowserSystemProxyMirrorTests \ test-without-building - - name: Run Cloud notification dismiss parity regression - if: ${{ matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD) }} - run: | - # Focused gate for https://github.com/manaflow-ai/cmux/issues/13000. - # The tolerant full-suite step accepts ordinary Swift Testing - # failures, so keep the one-read-state contract between the local - # store, the left sidebar, and the Cloud tree on a non-tolerant - # only-testing invocation. - set -euo pipefail - scripts/ci/run-in-console-session.sh \ - scripts/ci/run-app-host-xcodebuild.sh \ - -xctestrun "$CMUX_APP_HOST_XCTESTRUN" \ - -destination "platform=macOS" \ - CMUX_SKIP_ZIG_BUILD=1 \ - -only-testing:cmuxTests/CloudNotificationDismissParityTests \ - test-without-building - - - name: Run agent restore admission regression - if: ${{ matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD) }} - run: | - # Focused gate for https://github.com/manaflow-ai/cmux/issues/12158. - # The tolerant full-suite step accepts ordinary Swift Testing - # failures, so keep restore admission under hook-store churn, the - # per-kind store completeness rule, and the surviving-owner notice - # on a non-tolerant only-testing invocation. - set -euo pipefail - scripts/ci/run-in-console-session.sh \ - scripts/ci/run-app-host-xcodebuild.sh \ - -xctestrun "$CMUX_APP_HOST_XCTESTRUN" \ - -destination "platform=macOS" \ - CMUX_SKIP_ZIG_BUILD=1 \ - -only-testing:cmuxTests/AgentRestoreLiveOwnerAdmissionTests \ - test-without-building - - - name: Run Option/Alt sided-modifier regression - if: ${{ matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD) }} - run: | - set -euo pipefail - scripts/ci/run-in-console-session.sh \ - scripts/ci/run-app-host-xcodebuild.sh \ - -xctestrun "$CMUX_APP_HOST_XCTESTRUN" \ - -destination "platform=macOS" \ - CMUX_SKIP_ZIG_BUILD=1 \ - -only-testing:cmuxTests/GhosttyOptionAsAltModsTests \ - test-without-building - - - name: Run ssh-session-attach anchor regression - if: ${{ matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD) }} - run: | - # Focused gate for https://github.com/manaflow-ai/cmux/issues/7367. - # The full "Run unit tests" step tolerates any xcodebuild failure - # whose last test summary reports "(0 unexpected)", and test - # assertion failures never increment the unexpected count on these - # runners — so a failing regression assertion in the sharded run - # cannot turn the shard red. Keep this targeted only-testing - # invocation as a non-tolerant guard for the ssh-session-attach - # split-anchor regression. - set -euo pipefail - scripts/ci/run-in-console-session.sh \ - scripts/ci/run-app-host-xcodebuild.sh \ - -xctestrun "$CMUX_APP_HOST_XCTESTRUN" \ - -destination "platform=macOS" \ - CMUX_SKIP_ZIG_BUILD=1 \ - -only-testing:cmuxTests/CLISSHSessionAttachAnchorTests \ - test-without-building - - name: Run focused browser regressions if: ${{ matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_B_SHARD) }} run: | From f69e7787bcaab6dd18e695e2118bdf3bf24b3d37 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 05:27:34 -0700 Subject: [PATCH 4/7] test(ci): update focused ownership after broad fold --- tests/test_ci_cmux_unit_test_shard.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_ci_cmux_unit_test_shard.py b/tests/test_ci_cmux_unit_test_shard.py index b77aa3cc5fcd..2c7011fd4d01 100644 --- a/tests/test_ci_cmux_unit_test_shard.py +++ b/tests/test_ci_cmux_unit_test_shard.py @@ -544,12 +544,8 @@ def main() -> int: shard_selectors = output.read_text(encoding="utf-8").splitlines() repo_assigned_selectors.extend(shard_selectors) for focused_selector in ( - "-only-testing:cmuxTests/AgentRestoreLiveOwnerAdmissionTests", "-only-testing:cmuxTests/BrowserSystemProxyMirrorTests", - "-only-testing:cmuxTests/CLISSHSessionAttachAnchorTests", - "-only-testing:cmuxTests/CloudNotificationDismissParityTests", "-only-testing:cmuxTests/GhosttyTerminalViewVisibilityPolicyTests", - "-only-testing:cmuxTests/GhosttyOptionAsAltModsTests", "-only-testing:cmuxTests/GlobalSearchShortcutBehaviorTests", "-only-testing:cmuxTests/KeyboardShortcutSettingsFileStoreNoOpPersistenceTests", "-only-testing:cmuxTests/RemoteTmuxMirrorLayoutIdentityTests", From fd8805caebc6764b6d47c19cf5c6ce86b39fc83b Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 10:43:55 -0700 Subject: [PATCH 5/7] Prove folded suites remain in broad shards --- tests/test_ci_cmux_unit_test_shard.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_ci_cmux_unit_test_shard.py b/tests/test_ci_cmux_unit_test_shard.py index 2c7011fd4d01..5bbf907189ca 100644 --- a/tests/test_ci_cmux_unit_test_shard.py +++ b/tests/test_ci_cmux_unit_test_shard.py @@ -413,7 +413,21 @@ def check_truthful_broad_suites_leave_focused_gates() -> int: if stale: print(f"FAIL: truthful broad suites still have dedicated focused ownership: {stale}") return 1 - print("PASS: truthful broad suites are owned by the measured shard batch") + + discovered = { + selector.identifier.split("/", 2)[1] + for selector in helper.discover_selectors(ROOT / "cmuxTests") + if selector.identifier.startswith("cmuxTests/") + } + missing = sorted(folded - discovered) + if missing: + print( + "FAIL: folded suites are absent from broad shard discovery: " + f"{missing}" + ) + return 1 + + print("PASS: truthful broad suites are discovered and owned by the measured shard batch") return 0 From b7757eeb86af87667425465f2de5f3dc084b3c44 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 10:47:50 -0700 Subject: [PATCH 6/7] test(ci): discover folded suites from repository root --- tests/test_ci_cmux_unit_test_shard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_ci_cmux_unit_test_shard.py b/tests/test_ci_cmux_unit_test_shard.py index 5bbf907189ca..74cb362bfa3a 100644 --- a/tests/test_ci_cmux_unit_test_shard.py +++ b/tests/test_ci_cmux_unit_test_shard.py @@ -416,7 +416,7 @@ def check_truthful_broad_suites_leave_focused_gates() -> int: discovered = { selector.identifier.split("/", 2)[1] - for selector in helper.discover_selectors(ROOT / "cmuxTests") + for selector in helper.discover_selectors(ROOT) if selector.identifier.startswith("cmuxTests/") } missing = sorted(folded - discovered) From 2c5d2453b7552dc73716b47689eb3d50553e2fc9 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 21 Sep 2026 16:01:19 -0700 Subject: [PATCH 7/7] ci: refresh checks against current main