Merge pull request #124080 from claudiubelu/skip-windows-tests

Skip failing Windows tests
This commit is contained in:
Kubernetes Prow Robot 2024-05-01 07:48:12 -07:00 committed by GitHub
commit 29a4812f03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 101 additions and 3 deletions

View File

@ -19,6 +19,7 @@ package main
import ( import (
"path/filepath" "path/filepath"
"reflect" "reflect"
goruntime "runtime"
"strings" "strings"
"testing" "testing"
@ -120,6 +121,10 @@ func TestHasTestFiles(t *testing.T) {
} }
func TestPackageDir(t *testing.T) { func TestPackageDir(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
cases := []struct { cases := []struct {
input *packages.Package input *packages.Package
expect string expect string
@ -152,6 +157,10 @@ func TestPackageDir(t *testing.T) {
} }
func TestHasPathPrefix(t *testing.T) { func TestHasPathPrefix(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
cases := []struct { cases := []struct {
base string base string
pfx string pfx string
@ -219,6 +228,10 @@ func checkAllErrorStrings(t *testing.T, errs []error, expect []string) {
} }
func TestSimpleForward(t *testing.T) { func TestSimpleForward(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
pkgs, err := loadPkgs("./testdata/simple-fwd/aaa") pkgs, err := loadPkgs("./testdata/simple-fwd/aaa")
if err != nil { if err != nil {
t.Fatalf("unexpected failure: %v", err) t.Fatalf("unexpected failure: %v", err)

View File

@ -23,6 +23,7 @@ import (
"net" "net"
"os" "os"
"path/filepath" "path/filepath"
goruntime "runtime"
"testing" "testing"
"k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd"
@ -202,6 +203,10 @@ func writeTestKubeconfig(t *testing.T, dir, name string, caCert *x509.Certificat
} }
func TestFileExists(t *testing.T) { func TestFileExists(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
tmpdir, err := os.MkdirTemp("", "") tmpdir, err := os.MkdirTemp("", "")
if err != nil { if err != nil {
t.Fatalf("Couldn't create tmpdir: %v", err) t.Fatalf("Couldn't create tmpdir: %v", err)
@ -303,6 +308,10 @@ func TestPKICertificateReadWriterExists(t *testing.T) {
} }
func TestKubeConfigReadWriterExists(t *testing.T) { func TestKubeConfigReadWriterExists(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
tmpdir, err := os.MkdirTemp("", "") tmpdir, err := os.MkdirTemp("", "")
if err != nil { if err != nil {
t.Fatalf("Couldn't create tmpdir: %v", err) t.Fatalf("Couldn't create tmpdir: %v", err)

View File

@ -20,6 +20,7 @@ import (
"context" "context"
"fmt" "fmt"
"math" "math"
goruntime "runtime"
"strings" "strings"
"sync" "sync"
"testing" "testing"
@ -2816,6 +2817,10 @@ func TestUpscaleCap(t *testing.T) {
} }
func TestUpscaleCapGreaterThanMaxReplicas(t *testing.T) { func TestUpscaleCapGreaterThanMaxReplicas(t *testing.T) {
// TODO: Remove skip once this issue is resolved: https://github.com/kubernetes/kubernetes/issues/124083
if goruntime.GOOS == "windows" {
t.Skip("Skip flaking test on Windows.")
}
tc := testCase{ tc := testCase{
minReplicas: 1, minReplicas: 1,
maxReplicas: 20, maxReplicas: 20,
@ -2847,6 +2852,10 @@ func TestUpscaleCapGreaterThanMaxReplicas(t *testing.T) {
} }
func TestMoreReplicasThanSpecNoScale(t *testing.T) { func TestMoreReplicasThanSpecNoScale(t *testing.T) {
// TODO: Remove skip once this issue is resolved: https://github.com/kubernetes/kubernetes/issues/124083
if goruntime.GOOS == "windows" {
t.Skip("Skip flaking test on Windows.")
}
tc := testCase{ tc := testCase{
minReplicas: 1, minReplicas: 1,
maxReplicas: 8, maxReplicas: 8,

View File

@ -19,6 +19,7 @@ package tainteviction
import ( import (
"context" "context"
"fmt" "fmt"
goruntime "runtime"
"sort" "sort"
"testing" "testing"
"time" "time"
@ -247,6 +248,7 @@ func TestUpdatePod(t *testing.T) {
expectPatch bool expectPatch bool
expectDelete bool expectDelete bool
enablePodDisruptionConditions bool enablePodDisruptionConditions bool
skipOnWindows bool
}{ }{
{ {
description: "scheduling onto tainted Node results in patch and delete when PodDisruptionConditions enabled", description: "scheduling onto tainted Node results in patch and delete when PodDisruptionConditions enabled",
@ -296,11 +298,16 @@ func TestUpdatePod(t *testing.T) {
"node1": {createNoExecuteTaint(1)}, "node1": {createNoExecuteTaint(1)},
}, },
expectDelete: true, expectDelete: true,
skipOnWindows: true,
}, },
} }
for _, item := range testCases { for _, item := range testCases {
t.Run(item.description, func(t *testing.T) { t.Run(item.description, func(t *testing.T) {
if item.skipOnWindows && goruntime.GOOS == "windows" {
// TODO: remove skip once the flaking test has been fixed.
t.Skip("Skip flaking test on Windows.")
}
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodDisruptionConditions, item.enablePodDisruptionConditions) featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodDisruptionConditions, item.enablePodDisruptionConditions)
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
fakeClientset := fake.NewSimpleClientset(&corev1.PodList{Items: []corev1.Pod{*item.prevPod}}) fakeClientset := fake.NewSimpleClientset(&corev1.PodList{Items: []corev1.Pod{*item.prevPod}})

View File

@ -30,6 +30,8 @@ import (
) )
func TestMakeMountsWindows(t *testing.T) { func TestMakeMountsWindows(t *testing.T) {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
container := v1.Container{ container := v1.Container{
VolumeMounts: []v1.VolumeMount{ VolumeMounts: []v1.VolumeMount{
{ {

View File

@ -249,6 +249,7 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
for desc, test := range map[string]struct { for desc, test := range map[string]struct {
input *runtimeapi.ContainerStatus input *runtimeapi.ContainerStatus
expected *kubecontainer.Status expected *kubecontainer.Status
skipOnWindows bool
}{ }{
"container reporting cpu and memory": { "container reporting cpu and memory": {
input: &runtimeapi.ContainerStatus{ input: &runtimeapi.ContainerStatus{
@ -289,6 +290,7 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
MemoryLimit: resource.NewQuantity(524288000, resource.BinarySI), MemoryLimit: resource.NewQuantity(524288000, resource.BinarySI),
}, },
}, },
skipOnWindows: true,
}, },
"container reporting cpu only": { "container reporting cpu only": {
input: &runtimeapi.ContainerStatus{ input: &runtimeapi.ContainerStatus{
@ -357,6 +359,10 @@ func TestToKubeContainerStatusWithResources(t *testing.T) {
}, },
} { } {
t.Run(desc, func(t *testing.T) { t.Run(desc, func(t *testing.T) {
if test.skipOnWindows && goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
actual := toKubeContainerStatus(test.input, cid.Type) actual := toKubeContainerStatus(test.input, cid.Type)
assert.Equal(t, test.expected, actual, desc) assert.Equal(t, test.expected, actual, desc)
}) })

View File

@ -151,6 +151,9 @@ func TestCalculateCPUMaximum(t *testing.T) {
} }
func TestCalculateWindowsResources(t *testing.T) { func TestCalculateWindowsResources(t *testing.T) {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
_, _, fakeRuntimeSvc, err := createTestRuntimeManager() _, _, fakeRuntimeSvc, err := createTestRuntimeManager()
require.NoError(t, err) require.NoError(t, err)

View File

@ -24,6 +24,7 @@ import (
"io" "io"
"os" "os"
"path/filepath" "path/filepath"
goruntime "runtime"
"testing" "testing"
"time" "time"
@ -214,6 +215,10 @@ func TestReadLogs(t *testing.T) {
} }
func TestReadRotatedLog(t *testing.T) { func TestReadRotatedLog(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
tmpDir := t.TempDir() tmpDir := t.TempDir()
file, err := os.CreateTemp(tmpDir, "logfile") file, err := os.CreateTemp(tmpDir, "logfile")
if err != nil { if err != nil {

View File

@ -336,6 +336,10 @@ func TestCRIListPodStats(t *testing.T) {
} }
func TestListPodStatsStrictlyFromCRI(t *testing.T) { func TestListPodStatsStrictlyFromCRI(t *testing.T) {
if runtime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
ctx := context.Background() ctx := context.Background()
var ( var (
imageFsMountpoint = "/test/mount/point" imageFsMountpoint = "/test/mount/point"

View File

@ -20,6 +20,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
goruntime "runtime"
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@ -288,6 +289,7 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
runtimeUserns bool runtimeUserns bool
runtimeHandler string runtimeHandler string
success bool success bool
skipOnWindows bool
}{ }{
{ {
name: "no user namespace", name: "no user namespace",
@ -321,6 +323,7 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
expMode: runtimeapi.NamespaceMode_POD, expMode: runtimeapi.NamespaceMode_POD,
runtimeUserns: true, runtimeUserns: true,
success: true, success: true,
skipOnWindows: true,
}, },
{ {
name: "user namespace, but no runtime support", name: "user namespace, but no runtime support",
@ -345,6 +348,10 @@ func TestGetOrCreateUserNamespaceMappings(t *testing.T) {
for _, tc := range cases { for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
if tc.skipOnWindows && goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
// These tests will create the userns file, so use an existing podDir. // These tests will create the userns file, so use an existing podDir.
testUserNsPodsManager := &testUserNsPodsManager{ testUserNsPodsManager := &testUserNsPodsManager{
podDir: t.TempDir(), podDir: t.TempDir(),

View File

@ -35,6 +35,8 @@ func TestPerfCounter(t *testing.T) {
}{ }{
"CPU Query": { "CPU Query": {
counter: cpuQuery, counter: cpuQuery,
// TODO: remove skip once the test flake for CPU Query has been fixed.
skipCheck: true,
}, },
"Memory Prvate Working Set Query": { "Memory Prvate Working Set Query": {
counter: memoryPrivWorkingSetQuery, counter: memoryPrivWorkingSetQuery,

View File

@ -514,6 +514,10 @@ func testValidateProxyModeLinux(t *testing.T) {
} }
func testValidateProxyModeWindows(t *testing.T) { func testValidateProxyModeWindows(t *testing.T) {
// TODO: remove skip once the test has been fixed.
if runtime.GOOS == "windows" {
t.Skip("Skipping failing test on Windows.")
}
newPath := field.NewPath("KubeProxyConfiguration") newPath := field.NewPath("KubeProxyConfiguration")
for name, testCase := range map[string]struct { for name, testCase := range map[string]struct {
mode kubeproxyconfig.ProxyMode mode kubeproxyconfig.ProxyMode

View File

@ -48,6 +48,8 @@ const (
) )
func TestGetNetworkByName(t *testing.T) { func TestGetNetworkByName(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -66,6 +68,8 @@ func TestGetNetworkByName(t *testing.T) {
} }
func TestGetAllEndpointsByNetwork(t *testing.T) { func TestGetAllEndpointsByNetwork(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -111,6 +115,8 @@ func TestGetAllEndpointsByNetwork(t *testing.T) {
} }
func TestGetEndpointByID(t *testing.T) { func TestGetEndpointByID(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -150,6 +156,8 @@ func TestGetEndpointByID(t *testing.T) {
} }
func TestGetEndpointByIpAddressAndName(t *testing.T) { func TestGetEndpointByIpAddressAndName(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -200,6 +208,8 @@ func TestGetEndpointByIpAddressAndName(t *testing.T) {
} }
func TestCreateEndpointLocal(t *testing.T) { func TestCreateEndpointLocal(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -238,6 +248,8 @@ func TestCreateEndpointLocal(t *testing.T) {
} }
func TestCreateEndpointRemote(t *testing.T) { func TestCreateEndpointRemote(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
providerAddress := epPaAddress providerAddress := epPaAddress
@ -281,6 +293,8 @@ func TestCreateEndpointRemote(t *testing.T) {
} }
func TestDeleteEndpoint(t *testing.T) { func TestDeleteEndpoint(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -316,6 +330,8 @@ func TestDeleteEndpoint(t *testing.T) {
} }
func TestGetLoadBalancerExisting(t *testing.T) { func TestGetLoadBalancerExisting(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
lbs := make(map[loadBalancerIdentifier]*(loadBalancerInfo)) lbs := make(map[loadBalancerIdentifier]*(loadBalancerInfo))
@ -389,6 +405,8 @@ func TestGetLoadBalancerExisting(t *testing.T) {
} }
func TestGetLoadBalancerNew(t *testing.T) { func TestGetLoadBalancerNew(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
// We keep this empty to ensure we test for new load balancer creation. // We keep this empty to ensure we test for new load balancer creation.
@ -441,6 +459,8 @@ func TestGetLoadBalancerNew(t *testing.T) {
} }
func TestDeleteLoadBalancer(t *testing.T) { func TestDeleteLoadBalancer(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
hns := hns{hcn: newHcnImpl()} hns := hns{hcn: newHcnImpl()}
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
@ -506,6 +526,8 @@ func mustTestNetwork(t *testing.T) *hcn.HostComputeNetwork {
} }
func TestHashEndpoints(t *testing.T) { func TestHashEndpoints(t *testing.T) {
// TODO: remove skip once the test has been fixed.
t.Skip("Skipping failing test on Windows.")
Network := mustTestNetwork(t) Network := mustTestNetwork(t)
// Create endpoint A // Create endpoint A
ipConfigA := &hcn.IpConfig{ ipConfigA := &hcn.IpConfig{

View File

@ -24,6 +24,7 @@ import (
"math/rand" "math/rand"
"reflect" "reflect"
"regexp" "regexp"
goruntime "runtime"
"sort" "sort"
"strconv" "strconv"
"sync" "sync"
@ -510,6 +511,10 @@ func TestSchedulerMultipleProfilesScheduling(t *testing.T) {
// TestSchedulerGuaranteeNonNilNodeInSchedulingCycle is for detecting potential panic on nil Node when iterating Nodes. // TestSchedulerGuaranteeNonNilNodeInSchedulingCycle is for detecting potential panic on nil Node when iterating Nodes.
func TestSchedulerGuaranteeNonNilNodeInSchedulingCycle(t *testing.T) { func TestSchedulerGuaranteeNonNilNodeInSchedulingCycle(t *testing.T) {
if goruntime.GOOS == "windows" {
// TODO: remove skip once the failing test has been fixed.
t.Skip("Skip failing test on Windows.")
}
random := rand.New(rand.NewSource(time.Now().UnixNano())) random := rand.New(rand.NewSource(time.Now().UnixNano()))
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() defer cancel()