You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Double-check locking pattern without proper synchronization:
if(state.IsCompleted||testContext.Resultis not null){state.TryMarkCompleted();return;}// ... Send updateif(state.IsCompleted||testContext.Resultis not null){state.TryMarkCompleted();return;}
Between the first check and sending the update, another thread could mark the test as completed, resulting in state updates being sent after test completion. This could cause IDE test explorers to receive updates after seeing the final state, causing UI glitches.
Timer Leak (Lines 80-85)
Timer is created with new Timer() but if an exception occurs during CreateStreamingState, the timer could leak. Dispose() is only called in CleanupTest().
Suggested Fix
Use a single atomic check: if (!state.TryMarkCompleted()) return;
Wrap state creation in try-catch and always dispose the timer on failure
Description
IdeStreamingSink.cs (Lines 147-152)
Double-check locking pattern without proper synchronization:
Between the first check and sending the update, another thread could mark the test as completed, resulting in state updates being sent after test completion. This could cause IDE test explorers to receive updates after seeing the final state, causing UI glitches.
Timer Leak (Lines 80-85)
Timeris created withnew Timer()but if an exception occurs duringCreateStreamingState, the timer could leak.Dispose()is only called inCleanupTest().Suggested Fix
if (!state.TryMarkCompleted()) return;