Skip to content

Build a WinForms message-pump test seam (Application.Run() background thread) to unblock 9 QfcItemController orchestration members #230

Description

@drmoisan

Context

Across issue #227's remediation cycles, QfcItemController's coverage-exemption boundary was
reduced from 103 to 19 members. The remaining 9 residuals in that boundary are all blocked by the
same structural gap: they await itemViewer.UiSyncContext (or an equivalent continuation posted
through the ambient WindowsFormsSynchronizationContext), and this repo has no WinForms analogue of
the WPF Dispatcher.Run()-on-a-background-thread test seam it already built for IUiDispatcher
(see UtilitiesCS.Test/Threading/* and QfcItemController.TestSupport.cs's StartRunningDispatcher()).

Awaiting a continuation captured by a WindowsFormsSynchronizationContext on a thread-pool MSTest
async-test thread (no message pump) can hang indefinitely — documented in this exact repo at
UtilitiesCS.Test/Extensions/AsyncSerialization_Tests.cs:362-374.

Affected members (QuickFiler/Controllers/QfcItemController.*.cs)

  • Initialize(bool async), InitializeAsync, InitializeGraphicsAsync, InitializeSequentialAsync
  • CreateAsync, CreateSequentialAsync (static factories; barrier inherited from the above)
  • ResolveControlGroupsAsync(ItemViewer) (the async half; the synchronous half was de-exempted in
    Refactor: qfc-item-controller-testability #227 cycle 5 via headless ItemViewer construction)
  • InitializeWebViewAsync (also has a residual concrete-ItemViewer accessor barrier, tracked
    separately)

What's needed

A WinForms Application.Run()-on-a-dedicated-background-thread test seam, analogous to the existing
StartRunningDispatcher() WPF pattern, that lets a test:

  1. Start a real WinForms message pump on a background thread.
  2. Marshal a headless ItemViewer's continuations through it.
  3. Await completion deterministically without hanging the test thread.

Scope note

This was evaluated during #227 cycle-5's research
(artifacts/research/2026-07-02T16-15-qfc-item-controller-headless-itemviewer-research.md, §1.3)
and explicitly deferred as "a materially larger, distinct piece of test infrastructure ... out of
scope to build inside this research task." It is tracked here as its own initiative, analogous to
how #197 tracks the repo-wide coverage uplift. Not a blocker for #227's merge.

References

  • docs/features/active/2026-06-29-qfc-item-controller-testability-227/evidence/other/exemption-boundary.2026-07-02T17-00.md
  • docs/features/active/2026-06-29-qfc-item-controller-testability-227/maintainer-decision.2026-07-02.md
  • artifacts/research/2026-07-02T16-15-qfc-item-controller-headless-itemviewer-research.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions