Skip to content

Fix/test isolation - #724

Merged
Hirogen merged 3 commits into
Developmentfrom
fix/test-isolation
Oct 3, 2026
Merged

Hirogen merged 3 commits into
Developmentfrom
fix/test-isolation

Conversation

@Hirogen

@Hirogen Hirogen commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fix UI test hangs and keep tests out of the user's configuration

  • Tests no longer touch %APPDATA%\LogExpert: ConfigManager.ConfigDir and PluginValidator are redirected to temp dirs in every test assembly; a guard test enforces it.
  • MenuToolbarController / LedIndicatorService check the UI thread by thread id instead of SynchronizationContext identity, which re-posted forever on the UI thread or ran icon updates cross-thread and deadlocked MarkerWindowTests.
  • UI tests that open a Log Tab Window run under the WinForms synchronization context; cross-thread control access now fails tests; a 3-minute hang timeout applies to all test runs (src/tests.runsettings).

BRUNER Patrick added 3 commits October 3, 2026 11:59
JSONSaveTest and the portable-mode tests saved, created, moved and deleted
files in %APPDATA%\LogExpert through ConfigManager.Instance, overwriting the
developer's settings.json with test data on every full run.

ConfigDir now has an internal setter, and an assembly-wide SetUpFixture
points it at a temporary directory before any test runs. A guard test fails
if the tests ever see the real directory again.
MenuToolbarController and LedIndicatorService decided whether to marshal by
comparing the current SynchronizationContext with the one captured at
construction. On the UI thread under a different context instance they
re-posted to themselves forever; under NUnit's context their callbacks ran
on other threads and set form icons cross-thread, which later left a Log
Window's teardown blocked in SetWindowRgn. They now compare thread ids.

UI tests that open a Log Tab Window install the WinForms synchronization
context the app runs with, cross-thread control access fails the test
instead of deadlocking, and a 3-minute VSTest hang timeout for every test
project ends a hung run with a dump and the test name.
PluginValidator reads and creates trusted-plugins.json in %APPDATA%\LogExpert
until Initialize is called, which only the app does; every test assembly that
loads plugins rewrote the developer's real file. Each of them now points it at
a temporary directory before any test runs, and the isolation guard test also
checks the plugin trust path.
Comment thread src/LogExpert.UI.Tests/HiddenLinesWindowTests.cs Dismissed
Comment thread src/LogExpert.UI.Tests/MarkerWindowTests.cs Dismissed
@Hirogen
Hirogen merged commit 92f4de3 into Development Oct 3, 2026
3 checks passed
@Hirogen
Hirogen deleted the fix/test-isolation branch October 3, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant