Skip to content

Commit 29a4812

Browse files
authored
Merge pull request kubernetes#124080 from claudiubelu/skip-windows-tests
Skip failing Windows tests
2 parents 7143856 + 2be8bae commit 29a4812

File tree

14 files changed

+101
-3
lines changed

14 files changed

+101
-3
lines changed

cmd/import-boss/main_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package main
1919
import (
2020
"path/filepath"
2121
"reflect"
22+
goruntime "runtime"
2223
"strings"
2324
"testing"
2425

@@ -120,6 +121,10 @@ func TestHasTestFiles(t *testing.T) {
120121
}
121122

122123
func TestPackageDir(t *testing.T) {
124+
if goruntime.GOOS == "windows" {
125+
// TODO: remove skip once the failing test has been fixed.
126+
t.Skip("Skip failing test on Windows.")
127+
}
123128
cases := []struct {
124129
input *packages.Package
125130
expect string
@@ -152,6 +157,10 @@ func TestPackageDir(t *testing.T) {
152157
}
153158

154159
func TestHasPathPrefix(t *testing.T) {
160+
if goruntime.GOOS == "windows" {
161+
// TODO: remove skip once the failing test has been fixed.
162+
t.Skip("Skip failing test on Windows.")
163+
}
155164
cases := []struct {
156165
base string
157166
pfx string
@@ -219,6 +228,10 @@ func checkAllErrorStrings(t *testing.T, errs []error, expect []string) {
219228
}
220229

221230
func TestSimpleForward(t *testing.T) {
231+
if goruntime.GOOS == "windows" {
232+
// TODO: remove skip once the failing test has been fixed.
233+
t.Skip("Skip failing test on Windows.")
234+
}
222235
pkgs, err := loadPkgs("./testdata/simple-fwd/aaa")
223236
if err != nil {
224237
t.Fatalf("unexpected failure: %v", err)

cmd/kubeadm/app/phases/certs/renewal/readwriter_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"net"
2424
"os"
2525
"path/filepath"
26+
goruntime "runtime"
2627
"testing"
2728

2829
"k8s.io/client-go/tools/clientcmd"
@@ -202,6 +203,10 @@ func writeTestKubeconfig(t *testing.T, dir, name string, caCert *x509.Certificat
202203
}
203204

204205
func TestFileExists(t *testing.T) {
206+
if goruntime.GOOS == "windows" {
207+
// TODO: remove skip once the failing test has been fixed.
208+
t.Skip("Skip failing test on Windows.")
209+
}
205210
tmpdir, err := os.MkdirTemp("", "")
206211
if err != nil {
207212
t.Fatalf("Couldn't create tmpdir: %v", err)
@@ -303,6 +308,10 @@ func TestPKICertificateReadWriterExists(t *testing.T) {
303308
}
304309

305310
func TestKubeConfigReadWriterExists(t *testing.T) {
311+
if goruntime.GOOS == "windows" {
312+
// TODO: remove skip once the failing test has been fixed.
313+
t.Skip("Skip failing test on Windows.")
314+
}
306315
tmpdir, err := os.MkdirTemp("", "")
307316
if err != nil {
308317
t.Fatalf("Couldn't create tmpdir: %v", err)

pkg/controller/podautoscaler/horizontal_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"fmt"
2222
"math"
23+
goruntime "runtime"
2324
"strings"
2425
"sync"
2526
"testing"
@@ -2816,6 +2817,10 @@ func TestUpscaleCap(t *testing.T) {
28162817
}
28172818

28182819
func TestUpscaleCapGreaterThanMaxReplicas(t *testing.T) {
2820+
// TODO: Remove skip once this issue is resolved: https://github.com/kubernetes/kubernetes/issues/124083
2821+
if goruntime.GOOS == "windows" {
2822+
t.Skip("Skip flaking test on Windows.")
2823+
}
28192824
tc := testCase{
28202825
minReplicas: 1,
28212826
maxReplicas: 20,
@@ -2847,6 +2852,10 @@ func TestUpscaleCapGreaterThanMaxReplicas(t *testing.T) {
28472852
}
28482853

28492854
func TestMoreReplicasThanSpecNoScale(t *testing.T) {
2855+
// TODO: Remove skip once this issue is resolved: https://github.com/kubernetes/kubernetes/issues/124083
2856+
if goruntime.GOOS == "windows" {
2857+
t.Skip("Skip flaking test on Windows.")
2858+
}
28502859
tc := testCase{
28512860
minReplicas: 1,
28522861
maxReplicas: 8,

pkg/controller/tainteviction/taint_eviction_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package tainteviction
1919
import (
2020
"context"
2121
"fmt"
22+
goruntime "runtime"
2223
"sort"
2324
"testing"
2425
"time"
@@ -247,6 +248,7 @@ func TestUpdatePod(t *testing.T) {
247248
expectPatch bool
248249
expectDelete bool
249250
enablePodDisruptionConditions bool
251+
skipOnWindows bool
250252
}{
251253
{
252254
description: "scheduling onto tainted Node results in patch and delete when PodDisruptionConditions enabled",
@@ -295,12 +297,17 @@ func TestUpdatePod(t *testing.T) {
295297
taintedNodes: map[string][]corev1.Taint{
296298
"node1": {createNoExecuteTaint(1)},
297299
},
298-
expectDelete: true,
300+
expectDelete: true,
301+
skipOnWindows: true,
299302
},
300303
}
301304

302305
for _, item := range testCases {
303306
t.Run(item.description, func(t *testing.T) {
307+
if item.skipOnWindows && goruntime.GOOS == "windows" {
308+
// TODO: remove skip once the flaking test has been fixed.
309+
t.Skip("Skip flaking test on Windows.")
310+
}
304311
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodDisruptionConditions, item.enablePodDisruptionConditions)
305312
ctx, cancel := context.WithCancel(context.Background())
306313
fakeClientset := fake.NewSimpleClientset(&corev1.PodList{Items: []corev1.Pod{*item.prevPod}})

pkg/kubelet/kubelet_pods_windows_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030
)
3131

3232
func TestMakeMountsWindows(t *testing.T) {
33+
// TODO: remove skip once the failing test has been fixed.
34+
t.Skip("Skip failing test on Windows.")
3335
container := v1.Container{
3436
VolumeMounts: []v1.VolumeMount{
3537
{

pkg/kubelet/kuberuntime/kuberuntime_container_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
247247
)
248248

249249
for desc, test := range map[string]struct {
250-
input *runtimeapi.ContainerStatus
251-
expected *kubecontainer.Status
250+
input *runtimeapi.ContainerStatus
251+
expected *kubecontainer.Status
252+
skipOnWindows bool
252253
}{
253254
"container reporting cpu and memory": {
254255
input: &runtimeapi.ContainerStatus{
@@ -289,6 +290,7 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
289290
MemoryLimit: resource.NewQuantity(524288000, resource.BinarySI),
290291
},
291292
},
293+
skipOnWindows: true,
292294
},
293295
"container reporting cpu only": {
294296
input: &runtimeapi.ContainerStatus{
@@ -357,6 +359,10 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
357359
},
358360
} {
359361
t.Run(desc, func(t *testing.T) {
362+
if test.skipOnWindows && goruntime.GOOS == "windows" {
363+
// TODO: remove skip once the failing test has been fixed.
364+
t.Skip("Skip failing test on Windows.")
365+
}
360366
actual := toKubeContainerStatus(test.input, cid.Type)
361367
assert.Equal(t, test.expected, actual, desc)
362368
})

pkg/kubelet/kuberuntime/kuberuntime_container_windows_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ func TestCalculateCPUMaximum(t *testing.T) {
151151
}
152152

153153
func TestCalculateWindowsResources(t *testing.T) {
154+
// TODO: remove skip once the failing test has been fixed.
155+
t.Skip("Skip failing test on Windows.")
156+
154157
_, _, fakeRuntimeSvc, err := createTestRuntimeManager()
155158
require.NoError(t, err)
156159

pkg/kubelet/kuberuntime/logs/logs_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"io"
2525
"os"
2626
"path/filepath"
27+
goruntime "runtime"
2728
"testing"
2829
"time"
2930

@@ -214,6 +215,10 @@ func TestReadLogs(t *testing.T) {
214215
}
215216

216217
func TestReadRotatedLog(t *testing.T) {
218+
if goruntime.GOOS == "windows" {
219+
// TODO: remove skip once the failing test has been fixed.
220+
t.Skip("Skip failing test on Windows.")
221+
}
217222
tmpDir := t.TempDir()
218223
file, err := os.CreateTemp(tmpDir, "logfile")
219224
if err != nil {

pkg/kubelet/stats/cri_stats_provider_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ func TestCRIListPodStats(t *testing.T) {
336336
}
337337

338338
func TestListPodStatsStrictlyFromCRI(t *testing.T) {
339+
if runtime.GOOS == "windows" {
340+
// TODO: remove skip once the failing test has been fixed.
341+
t.Skip("Skip failing test on Windows.")
342+
}
339343
ctx := context.Background()
340344
var (
341345
imageFsMountpoint = "/test/mount/point"

pkg/kubelet/userns/userns_manager_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"errors"
2121
"fmt"
2222
"os"
23+
goruntime "runtime"
2324
"testing"
2425

2526
"github.com/stretchr/testify/assert"
@@ -288,6 +289,7 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
288289
runtimeUserns bool
289290
runtimeHandler string
290291
success bool
292+
skipOnWindows bool
291293
}{
292294
{
293295
name: "no user namespace",
@@ -321,6 +323,7 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
321323
expMode: runtimeapi.NamespaceMode_POD,
322324
runtimeUserns: true,
323325
success: true,
326+
skipOnWindows: true,
324327
},
325328
{
326329
name: "user namespace, but no runtime support",
@@ -345,6 +348,10 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
345348

346349
for _, tc := range cases {
347350
t.Run(tc.name, func(t *testing.T) {
351+
if tc.skipOnWindows && goruntime.GOOS == "windows" {
352+
// TODO: remove skip once the failing test has been fixed.
353+
t.Skip("Skip failing test on Windows.")
354+
}
348355
// These tests will create the userns file, so use an existing podDir.
349356
testUserNsPodsManager := &testUserNsPodsManager{
350357
podDir: t.TempDir(),

0 commit comments

Comments
 (0)