Skip to content

Bug: winformspumphost-tests-load-flaky-visible-window #511

Description

@drmoisan
  • Work Mode: full-bug

Summary

Unit tests built on QuickFiler.Test/TestSupport/WinFormsPumpHost.cs start a real WinForms message pump (Application.Run) on a dedicated STA thread and construct real WinForms controls. They fail nondeterministically when the machine is under heavy CPU load, and they display a visible window during an otherwise headless test run.

Environment

  • OS/version: Windows 11 Pro 10.0.26200
  • Runtime: .NET Framework 4.8.1, MSTest via vstest.console.exe (VS18 test platform)
  • Command/flags used: ./scripts/vscode/Invoke-MSTestWithCoverage.ps1 -SearchRoot . (full-suite run with coverage)
  • Data source or fixture: QuickFiler.Test/TestSupport/WinFormsPumpHost.cs; affected suites include QfcItemController_InitializationTests (the *ThroughThePumpHost* cases) and WpfDispatcherYieldTests

Steps to Reproduce

  1. Drive the machine to sustained high CPU utilization (observed at approximately 96%).
  2. Run the full MSTest suite with coverage using the command above.
  3. Repeat several times and observe both the pass/fail outcome and the desktop.

Expected Behavior

Unit tests are deterministic and headless. Per .claude/rules/general-unit-test.md, tests must produce the same result given the same inputs and must not depend on real wall-clock timing. No unit test should create a visible window on the developer's desktop.

Actual Behavior

  • The affected tests failed nondeterministically under load. During baseline capture for issue Bug: quickfiler-search-keystroke-focus-steal #438 on 2026-08-08, six attempts were required to obtain a clean full-suite baseline; the failures were confined to these suites and did not reproduce once the machine was idle.
  • A visible window appeared during the run, because the host constructs a real WinForms control and pumps a real message loop.

Logs / Screenshots

  • Attached minimal logs or screenshot
  • Snippet: no captured failure log is retained; the observation is recorded in the issue Bug: quickfiler-search-keystroke-focus-steal #438 execution report and in .claude/agent-memory/atomic-executor/project_winformspumphost_tests_load_flaky.md. A fresh capture under induced load should accompany the fix.

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Nondeterministic tests are corrosive to an autonomous development workflow: they force repeated full-suite reruns (six were needed for one baseline), and they train reviewers and agents to retry a red suite rather than investigate it, which is exactly the habit that lets a real regression through. The visible window also makes the suite unsuitable for unattended or headless CI execution.

Source

From: docs/features/potential/2026-08-08-winformspumphost-tests-load-flaky-visible-window.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions