From 71cbf63a0550109e9c135c27835c0b09142105d9 Mon Sep 17 00:00:00 2001 From: Blue Date: Fri, 24 Apr 2026 15:34:34 -0700 Subject: [PATCH 1/2] Fixed leaked container in NamedVolumesVhdSessionRecovery causing test failures in OpenContainer --- test/windows/WSLCTests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/windows/WSLCTests.cpp b/test/windows/WSLCTests.cpp index 7bde747f4..a2a0c6fbe 100644 --- a/test/windows/WSLCTests.cpp +++ b/test/windows/WSLCTests.cpp @@ -3670,6 +3670,7 @@ class WSLCTests WSLC_TEST_METHOD(NamedVolumesVhdSessionRecovery) { + WSLCDriverOption driverOpts[] = {{"SizeBytes", "1073741824"}}; ValidateNamedVolumeRecoveryContract("vhd", driverOpts, ARRAYSIZE(driverOpts)); @@ -3678,6 +3679,12 @@ class WSLCTests const std::string volumeName = "wslc-test-named-volume-vhd"; const std::string containerName = "wslc-test-container-vhd"; + // Prune containers on exit so this test doesn't leak "wslc-test-named-volume-vhd" on exit. + auto cleanup = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&]() { + PruneResult result; + LOG_IF_FAILED(m_defaultSession->PruneContainers(nullptr, 0, 0, &result.result)); + }); + WSLCVolumeOptions volumeOptions{}; volumeOptions.Name = volumeName.c_str(); volumeOptions.Driver = "vhd"; From a4c9df467b431d2876259930a9e010af4e7b2d5e Mon Sep 17 00:00:00 2001 From: Blue Date: Fri, 24 Apr 2026 15:43:22 -0700 Subject: [PATCH 2/2] Update comment --- test/windows/WSLCTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/windows/WSLCTests.cpp b/test/windows/WSLCTests.cpp index a2a0c6fbe..c15ebd37b 100644 --- a/test/windows/WSLCTests.cpp +++ b/test/windows/WSLCTests.cpp @@ -3679,7 +3679,7 @@ class WSLCTests const std::string volumeName = "wslc-test-named-volume-vhd"; const std::string containerName = "wslc-test-container-vhd"; - // Prune containers on exit so this test doesn't leak "wslc-test-named-volume-vhd" on exit. + // Prune containers on exit so this test doesn't leak "wslc-test-container-vhd" on exit. auto cleanup = wil::scope_exit_log(WI_DIAGNOSTICS_INFO, [&]() { PruneResult result; LOG_IF_FAILED(m_defaultSession->PruneContainers(nullptr, 0, 0, &result.result));