@samitouri / QOSAMI-WSL / commits / c491a1ee

Fix race condition causing errors in the wslc.exe tests (#40875)

Blue committed Jun 23, 2026 at 11:16 UTC c491a1ee50b72a14775ad2367a41ce7e3a2424c4
1 file changed -11
test/windows/wslc/e2e/WSLCE2EHelpers.cpp
-11
@@ -316,17 +316,6 @@ void EnsureContainerDoesNotExist(const std::wstring& containerName)
316 return;
317 }
318
319 - if (it->State == WSLCContainerState::WslcContainerStateRunning)
320 - {
321 - auto result = RunWslc(std::format(L"container kill {}", containerName));
322 - // Tolerate WSLC_E_CONTAINER_NOT_FOUND - container already stopped/removed
323 - if (result.ExitCode != 0 &&
324 - (!result.Stderr.has_value() || result.Stderr.value().find(L"WSLC_E_CONTAINER_NOT_FOUND") == std::wstring::npos))
325 - {
326 - result.Verify({.Stdout = L"", .Stderr = L"", .ExitCode = 0});
327 - }
328 - }
329 -
319 auto result = RunWslc(std::format(L"container remove --force {}", containerName));
320 // Tolerate WSLC_E_CONTAINER_NOT_FOUND - container already removed
321 if (result.ExitCode != 0 && (!result.Stderr.has_value() || result.Stderr.value().find(L"WSLC_E_CONTAINER_NOT_FOUND") == std::wstring::npos))