From 311c8bd3df1531d27fb7c7fe19c33ec49a9d2129 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 19 Aug 2026 14:15:21 +0200 Subject: [PATCH] test: lane the one Avalonia test that needs a real desktop session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MainWindowViewTests.CompiledMarkupAndEveryModalFocusPathRunInOneOwnedAvalonia Session is Lane=Manual. Measured across five environments on 2026-08-19: dev desktop PASS CI Windows box, over SSH PASS Windows under act_runner FAIL Linux, plain SSH FAIL Always the same shape — Test Case Cleanup, 'The calling thread cannot access this object', while a compositor is being CONSTRUCTED (Compositor..ctor -> DefaultRenderLoop.Add -> VerifyAccess). Two hypotheses were tested and disproved rather than assumed: serializing the assembly (first xunit.runner.json, then a compiled-in CollectionBehavior attribute, so delivery could not be the excuse) did not fix it, and removing the test's only await did not either — that attempt actively CAUSED the failure locally and was reverted. So it is neither parallelism nor a thread hop in the test body; it is Avalonia's headless session lifecycle without a desktop. The test is not weakened or deleted: the gate now runs 55/55 and this one runs on demand via --filter Lane=Manual, where it passes. That matches how the InstalledDat and Live lanes already work. --- tests/AcDream.Launcher.Tests/MainWindowViewTests.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/AcDream.Launcher.Tests/MainWindowViewTests.cs b/tests/AcDream.Launcher.Tests/MainWindowViewTests.cs index e01a0dce..6228f64f 100644 --- a/tests/AcDream.Launcher.Tests/MainWindowViewTests.cs +++ b/tests/AcDream.Launcher.Tests/MainWindowViewTests.cs @@ -48,7 +48,20 @@ public sealed class MainWindowViewTests ("UpdateCloseButton", typeof(Button)), ]; + // Lane=Manual: this is the ONE test in the repo that needs a real desktop + // session. Measured 2026-08-19 across five environments — passes on a dev + // desktop and on the CI Windows box over SSH; fails identically under + // act_runner's step context and on Linux, always in Test Case Cleanup with + // "The calling thread cannot access this object" while a compositor is + // being CONSTRUCTED (Compositor..ctor -> DefaultRenderLoop.Add -> + // VerifyAccess). Neither serializing the assembly (xunit.runner.json, then + // a compiled-in CollectionBehavior attribute) nor removing the test's only + // await changed it, so it is not parallelism and not a thread hop in the + // test body — it is Avalonia's headless session lifecycle in a + // desktop-less environment. Run it deliberately: + // dotnet test tests/AcDream.Launcher.Tests --filter Lane=Manual [AvaloniaFact] + [Trait("Lane", "Manual")] public async Task CompiledMarkupAndEveryModalFocusPathRunInOneOwnedAvaloniaSession() { // Avalonia's headless compositor is thread-affine. Keep the complete