From 6adc69312f8f929f5e285d8fd3806c269853e850 Mon Sep 17 00:00:00 2001 From: Kirtana Ashok Date: Fri, 11 Jul 2025 10:56:31 -0700 Subject: [PATCH 1/2] Remove WS2025 from CIs due to regression Signed-off-by: Kirtana Ashok (cherry picked from commit 117179ae1af952cbf1d006938270e57c3a777e4b) Signed-off-by: Kirtana Ashok --- .github/workflows/build-test-images.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/windows-hyperv-periodic.yml | 6 +----- .github/workflows/windows-periodic.yml | 6 +----- integration/images/volume-copy-up/Makefile | 6 +++--- integration/images/volume-ownership/Makefile | 6 +++--- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-test-images.yml b/.github/workflows/build-test-images.yml index f1d6027e1d..aa99d4ff69 100644 --- a/.github/workflows/build-test-images.yml +++ b/.github/workflows/build-test-images.yml @@ -9,7 +9,7 @@ on: azure_windows_image_id: description: Windows image URN to deploy required: true - default: MicrosoftWindowsServer:WindowsServer:2025-datacenter:latest + default: MicrosoftWindowsServer:WindowsServer:2022-datacenter:latest azure_vm_size: description: Windows image builder VM size required: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb87520f07..4e12d5e69d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,7 +188,7 @@ jobs: strategy: matrix: - os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, windows-2022, windows-2025] + os: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, macos-13, windows-2022] go-version: ["1.23.10", "1.24.4"] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -214,7 +214,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2025, windows-2022] + os: [windows-2022] cgroup_driver: [cgroupfs] defaults: diff --git a/.github/workflows/windows-hyperv-periodic.yml b/.github/workflows/windows-hyperv-periodic.yml index d0ba67dad9..6f4495d430 100644 --- a/.github/workflows/windows-hyperv-periodic.yml +++ b/.github/workflows/windows-hyperv-periodic.yml @@ -43,16 +43,12 @@ jobs: # (e.g. hitting resource limits in the `AZTestVMCreate` task) fail-fast: false matrix: - win_ver: [ltsc2022, ltsc2025] + win_ver: [ltsc2022] include: - win_ver: ltsc2022 AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk-g2:latest" AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2022-${{ github.run_id }} GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2022-hyperv/" - - win_ver: ltsc2025 - AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2025-Datacenter:latest" - AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2025-${{ github.run_id }} - GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2025-hyperv/" runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/windows-periodic.yml b/.github/workflows/windows-periodic.yml index ace42c63ef..e0136fedee 100644 --- a/.github/workflows/windows-periodic.yml +++ b/.github/workflows/windows-periodic.yml @@ -42,16 +42,12 @@ jobs: # (e.g. hitting resource limits in the `AZTestVMCreate` task) fail-fast: false matrix: - win_ver: [ltsc2022, ltsc2025] + win_ver: [ltsc2022] include: - win_ver: ltsc2022 AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk-g2:latest" AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2022-${{ github.run_id }} GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2022/" - - win_ver: ltsc2025 - AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2025-Datacenter:latest" - AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2025-${{ github.run_id }} - GOOGLE_BUCKET: "containerd-integration/logs/windows-ltsc2025/" runs-on: ubuntu-latest timeout-minutes: 90 steps: diff --git a/integration/images/volume-copy-up/Makefile b/integration/images/volume-copy-up/Makefile index 2380fb0351..99d8680853 100644 --- a/integration/images/volume-copy-up/Makefile +++ b/integration/images/volume-copy-up/Makefile @@ -33,8 +33,8 @@ endif OS ?= linux # Architectures supported: amd64, arm64 ARCH ?= amd64 -# OS Version for the Windows images: ltsc2022, ltsc2025 -OSVERSION ?= ltsc2022 +# OS Version for the Windows images: 1809, 20H2, ltsc2022 +OSVERSION ?= 1809 # The output type could either be docker (local), or registry. # If it is registry, it will also allow us to push the Windows images. @@ -46,7 +46,7 @@ ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ifneq ($(REMOTE_DOCKER_URL),) ALL_OS += windows -ALL_OSVERSIONS.windows := ltsc2022 ltsc2025 +ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022 ALL_OS_ARCH.windows = $(foreach osversion, ${ALL_OSVERSIONS.windows}, windows-amd64-${osversion}) BASE.windows := mcr.microsoft.com/windows/nanoserver endif diff --git a/integration/images/volume-ownership/Makefile b/integration/images/volume-ownership/Makefile index bdf53bbedc..67ab919e08 100644 --- a/integration/images/volume-ownership/Makefile +++ b/integration/images/volume-ownership/Makefile @@ -33,8 +33,8 @@ endif OS ?= linux # Architectures supported: amd64, arm64 ARCH ?= amd64 -# OS Version for the Windows images: ltsc2022, lts2025 -OSVERSION ?= ltsc2022 +# OS Version for the Windows images: 1809, 20H2, ltsc2022 +OSVERSION ?= 1809 # The output type could either be docker (local), or registry. # If it is registry, it will also allow us to push the Windows images. @@ -46,7 +46,7 @@ ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch)) ifneq ($(REMOTE_DOCKER_URL),) ALL_OS += windows -ALL_OSVERSIONS.windows := ltsc2022 ltsc2025 +ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022 ALL_OS_ARCH.windows = $(foreach osversion, ${ALL_OSVERSIONS.windows}, windows-amd64-${osversion}) BASE.windows := mcr.microsoft.com/windows/nanoserver endif From 6cc2a8d779e29045f279cef041bec3d0569e75db Mon Sep 17 00:00:00 2001 From: Kirtana Ashok Date: Fri, 11 Jul 2025 12:00:28 -0700 Subject: [PATCH 2/2] Fix intermittent test failures on Windows CIs Signed-off-by: Kirtana Ashok (cherry picked from commit 12daca5f644b63ca42a34a3d6c28cdf02084bd23) Signed-off-by: Kirtana Ashok --- .github/workflows/ci.yml | 8 ++-- core/content/testsuite/testsuite.go | 61 +++++++++++++++-------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e12d5e69d..71b9e1fc61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,10 +307,10 @@ jobs: run: mingw32-make.exe integration - run: if [ -f *-gotest.json ]; then echo '# Integration 1' >> $GITHUB_STEP_SUMMARY; teststat -markdown *-gotest.json >> $GITHUB_STEP_SUMMARY; fi if: always() - - run: script/test/test2annotation.sh ${TESTFILE} + - run: script/test/test2annotation.sh "$TESTFILE" env: TESTFILE: ${{github.workspace}}/test-integration-serial-gotest.json - if: always() + if: success() # Run the integration suite a second time. See discussion in github.com/containerd/containerd/pull/1759 - name: Integration 2 @@ -323,10 +323,10 @@ jobs: run: mingw32-make.exe integration - run: if [ -f *-gotest.json ]; then echo '# Integration 2' >> $GITHUB_STEP_SUMMARY; teststat -markdown *-gotest.json >> $GITHUB_STEP_SUMMARY; fi if: always() - - run: script/test/test2annotation.sh ${TESTFILE} + - run: script/test/test2annotation.sh "$TESTFILE" env: TESTFILE: ${{github.workspace}}/test-integration-parallel-gotest.json - if: always() + if: success() - name: CRI Integration Test env: diff --git a/core/content/testsuite/testsuite.go b/core/content/testsuite/testsuite.go index 6be61fe497..22a827a552 100644 --- a/core/content/testsuite/testsuite.go +++ b/core/content/testsuite/testsuite.go @@ -363,6 +363,15 @@ func checkRefNotAvailable(ctx context.Context, t *testing.T, cs content.Store, r } } +func discardWriter(t *testing.T, w content.Writer) { + if err := w.Truncate(0); err != nil { + t.Errorf("failed to truncate writer: %+v", err) + } + if err := w.Close(); err != nil { + t.Errorf("failed to close writer: %+v", err) + } +} + func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) { c1, d1 := createContent(256) _, d2 := createContent(256) @@ -376,9 +385,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) t.Fatal(err) } if _, err := w.Write(c1); err != nil { - if err := w.Close(); err != nil { - t.Errorf("Close error: %+v", err) - } + discardWriter(t, w) t.Fatal(err) } @@ -389,9 +396,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err == nil { t.Fatalf("Expected already exists error") } else if !errdefs.IsAlreadyExists(err) { - if err := w.Close(); err != nil { - t.Errorf("Close error: %+v", err) - } + discardWriter(t, w) t.Fatalf("Unexpected error: %+v", err) } @@ -403,9 +408,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) checkRefNotAvailable(ctx, t, cs, ref) if _, err := w.Write(c1); err != nil { - if err := w.Close(); err != nil { - t.Errorf("close error: %+v", err) - } + discardWriter(t, w) t.Fatal(err) } @@ -414,9 +417,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err == nil { t.Fatalf("Expected already exists error") } else if !errdefs.IsAlreadyExists(err) { - if err := w.Close(); err != nil { - t.Errorf("Close error: %+v", err) - } + discardWriter(t, w) t.Fatalf("Unexpected error: %+v", err) } w.Close() @@ -429,9 +430,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) checkRefNotAvailable(ctx, t, cs, ref) if _, err := w.Write(append(c1, []byte("more")...)); err != nil { - if err := w.Close(); err != nil { - t.Errorf("close error: %+v", err) - } + discardWriter(t, w) t.Fatal(err) } @@ -440,10 +439,11 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err == nil { t.Fatalf("Expected error from wrong digest") } else if !errdefs.IsFailedPrecondition(err) { - t.Errorf("Unexpected error: %+v", err) + discardWriter(t, w) + t.Fatalf("Unexpected error: %+v", err) } - w.Close() + w, err = content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { t.Fatal(err) @@ -456,10 +456,11 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err == nil { t.Fatalf("Expected error from wrong size") } else if !errdefs.IsFailedPrecondition(err) { - t.Errorf("Unexpected error: %+v", err) + discardWriter(t, w) + t.Fatalf("Unexpected error: %+v", err) } - w.Close() + w, err = content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { t.Fatal(err) @@ -469,13 +470,11 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) // Now expect commit to succeed if err := w.Commit(ctx, int64(len(c1))+4, ""); err != nil { - if err := w.Close(); err != nil { - t.Errorf("close error: %+v", err) - } + discardWriter(t, w) t.Fatalf("Failed to commit: %+v", err) } - w.Close() + // Create another writer with same reference w, err = content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { @@ -483,9 +482,7 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) } if _, err := w.Write(c1); err != nil { - if err := w.Close(); err != nil { - t.Errorf("close error: %+v", err) - } + discardWriter(t, w) t.Fatal(err) } @@ -496,13 +493,11 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err == nil { t.Fatalf("Expected already exists error") } else if !errdefs.IsAlreadyExists(err) { - if err := w.Close(); err != nil { - t.Errorf("close error: %+v", err) - } + discardWriter(t, w) t.Fatalf("Unexpected error: %+v", err) } - w.Close() + w, err = content.OpenWriter(ctx, cs, content.WithRef(ref)) if err != nil { t.Fatal(err) @@ -510,6 +505,9 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) checkRefNotAvailable(ctx, t, cs, ref) + if err := w.Truncate(0); err != nil { + t.Fatalf("failed to truncate writer: %+v", err) + } if err := w.Close(); err != nil { t.Fatalf("Close failed: %+v", err) } @@ -519,6 +517,9 @@ func checkCommitErrorState(ctx context.Context, t *testing.T, cs content.Store) if err != nil { t.Fatalf("Failed to open writer: %+v", err) } + if err := w.Truncate(0); err != nil { + t.Fatalf("failed to truncate writer: %+v", err) + } if err := w.Close(); err != nil { t.Fatalf("Close failed: %+v", err) }