RendererDtorAndThread unit tests are sometimes hanging #7286

Open
opened 2026-01-31 01:00:11 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Apr 5, 2020).

Environment

Windows build number: Version 10.0.18362.657
Windows Terminal version (if applicable): Commit 4f8acb4b9f

Steps to reproduce

In a cmd.exe shell, in the tools directory, run the RendererDtorAndThread tests repeatedly like this:

for /L %i in (1,1,1000) do runut /name:*RendererDtorAndThread*

Expected behavior

The tests should complete successfully every time.

Actual behavior

Invariably one of the runs will hang. It's not that big a deal when testing locally, because it doesn't happen that often, but it's annoying when it causes the CI build to timeout when submitting a PR (which I've had happen a couple of time now).

After reproducing the hang locally, I attaching to the process in a debugger, and found that the RenderThread was stuck waiting for the _hPaintEnabledEvent. I also noticed that the these tests used to have a Sleep which I think was added specifically to prevent this from happening. See here:

8476040481/src/host/ut_host/VtIoTests.cpp (L360-L365)

Uncommenting those Sleep calls seem to fix the problem, although the tests do then take much longer to run.

Originally created by @j4james on GitHub (Apr 5, 2020). # Environment Windows build number: Version 10.0.18362.657 Windows Terminal version (if applicable): Commit 4f8acb4b9fbd61196d0a5287749a58abe0fbaa28 # Steps to reproduce In a _cmd.exe_ shell, in the _tools_ directory, run the `RendererDtorAndThread` tests repeatedly like this: for /L %i in (1,1,1000) do runut /name:*RendererDtorAndThread* # Expected behavior The tests should complete successfully every time. # Actual behavior Invariably one of the runs will hang. It's not that big a deal when testing locally, because it doesn't happen that often, but it's annoying when it causes the CI build to timeout when submitting a PR (which I've had happen a couple of time now). After reproducing the hang locally, I attaching to the process in a debugger, and found that the `RenderThread` was stuck waiting for the `_hPaintEnabledEvent`. I also noticed that the these tests used to have a `Sleep` which I think was added specifically to prevent this from happening. See here: https://github.com/microsoft/terminal/blob/8476040481a7459d3b6deb94b498262c5cfeb5a4/src/host/ut_host/VtIoTests.cpp#L360-L365 Uncommenting those `Sleep` calls seem to fix the problem, although the tests do then take much longer to run.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7286