mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 21:37:23 +00:00
Merge pull request #12119 from kiashok/backport-windows-fixes-2.1
[release/2.1] Backport windows test fixes
This commit is contained in:
7 files changed
+46
-53
No files matched your search
@@ -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
|
||||
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user