280 Commits

Author SHA1 Message Date
PatrickLaabs
e909e0cf73 chore: replacement of toPtr helper functions with ptr packge 2025-07-08 09:48:56 +02:00
Dawei Wei
b35c5c0a30 e2e: Fix shadowed error in reboot test and clean up containers after reboot test (#131699)
* Fix test flakiness caused by shadowed error in reboot test and stale pods affecting eviction test

- Fixed a bug in `ExecCommandInContainerWithFullOutput` usage in `hybrid_network.go` where the `err` variable was shadowed, causing test failures to be silently ignored.
- Added cleanup logic in `eviction.go` to explicitly delete pods created by the reboot node test (e.g., `img-puller`, `reboot-host-test-windows`) before starting the eviction test.
- This improves reliability of the eviction test when the reboot test runs beforehand and leaves behind memory-consuming pods.

* Add cleanup containers in reboot node test

* Workaround for Calico HNS issue by avoiding eviction of undeletable pods

Add a workaround for a known Calico issue (https://github.com/projectcalico/calico/issues/6974) where pods on Windows nodes may become undeletable after a reboot. This causes the eviction manager to attempt evicting these pods but fail due to HNS namespace deletion errors.

The workaround avoids scheduling critical test pods on rebooted nodes to prevent interference.

TODO: Remove this workaround once the Calico issue is resolved.

* Fix the lint issue.

* Address comments
2025-05-22 12:40:35 -07:00
Dawei Wei
863168e474 e2e: stabilize Windows memory pressure eviction test
- Add logic to wait until memory-pressure taint is cleared before running the test.

This reduces test flakiness due to lingering node conditions between retries.
2025-05-06 09:25:06 -07:00
Kubernetes Prow Robot
ea08d4df93 Merge pull request #128946 from jackfrancis/SetPVCVACName-eventually-gomega
test: don't panic during an Eventually retry loop
2025-04-29 09:17:55 -07:00
Patrick Ohly
8bb7b05637 dependencies: github.com/client9/misspell -> github.com/golangci/misspell
github.com/client9/misspell was archived by the owner on Mar 26, 2025.
The golangci-lint team maintains a fork.

The newer code finds some misspellings which where missed before.
2025-04-28 15:44:04 +02:00
Jack Francis
53499d97ee prefer error over bool, prefer Should(gomega.Succeed())
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
2025-03-13 16:15:24 -07:00
Jack Francis
d54ff7441e test: don't panic during an Eventually retry loop
Signed-off-by: Jack Francis <jackfrancis@gmail.com>
2025-03-13 13:57:55 -07:00
Natasha Sarkar
eab9197d1a Add observedGeneration and validation to pod status and conditions 2025-03-06 20:08:06 +00:00
zylxjtu
3d318b57e3 revert the old loop to check if the node is rebooted 2025-02-28 19:39:21 +00:00
zylxjtu
f1612003ff Fix the node reboot validation failure 2025-02-20 21:28:38 +00:00
Elizabeth Martin Campos
d728eb47dc test(network): replace RCs with Deployments in util function jig.Run
See #119021
2025-02-11 14:48:17 +01:00
zylxjtu
f891092b87 Add the check of node rebooting in windows rebootnode test 2025-01-29 21:06:04 +00:00
zylxjtu
459952a067 Windows node graceful shutdown 2024-11-05 17:46:22 +00:00
James Sturtevant
f1af725850 Update kubectl exec to use correct format
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
2024-10-15 09:34:38 -07:00
Abhishek Kr Srivastav
95860cff1c Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <rajalakshmi.girish1@ibm.com>
Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
2024-09-20 12:36:38 +05:30
Kubernetes Prow Robot
d770dd695a Merge pull request #121888 from SD-13/e2e-gomega-be-true-or-false
Enhance boolean assertions when fail
2024-08-20 04:24:42 -07:00
Sujay
223aedcf6b enhance boolean assertions 2024-07-31 15:58:15 +00:00
Sohan Kunkerkar
c5b01a30d3 test/e2e/windows: drop securityContext test for ProcMount
Fixes https://github.com/kubernetes/kubernetes/issues/126180

As the ProcMountType feature is disabled by default in beta and relies
on the UserNamespacesSupport feature, which is also set to false in beta,
running this test is unnecessary.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2024-07-23 13:45:29 -04:00
Mark Rossetti
3683010a7c Adding e2e test to validate memory-pressure eviction on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2024-07-17 15:11:30 -07:00
Peter Hunt
4f57a1448d test/e2e: add test to ensure proc mount is stripped from windows pods
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-07-16 17:46:23 -04:00
Amim Knabben
e5de3c3a81 Increasing limit margin to 8% on pod cpu limit test 2024-07-02 14:09:51 -03:00
carlory
3812fa1d6d Fix kubelet on Windows fails if a pod has SecurityContext with RunAsUser.
Co-authored-by: rphillips <rphillips@redhat.com>
2024-05-23 12:44:51 +08:00
huweiwen
6ec421e2cf test/e2e: do not use global variable for image
We have "-kube-test-repo-list" command line flag to override the image registry. If we store it in global variable, then that overriding cannot take effect.

And this can cause puzzling bugs, e.g.: containerIsUnused() function will compare incorrect image address.
2024-04-22 19:29:39 +08:00
Kubernetes Prow Robot
cb3bd5bc41 Merge pull request #124205 from mkarrmann/wait-for-pods-e2e-cleanup-111092
chore/refactor(e2e tests): Solidify Contract for and Cleanup WaitForPodsRunningReady
2024-04-22 01:24:24 -07:00
Dan Winship
4a1058daa1 Fix networking feature tags in Windows hybrid network e2e 2024-04-20 11:24:50 -04:00
Matt Karrmann
3476833367 Check err in Windows e2e tests 2024-04-17 23:18:26 -05:00
Matt Karrmann
bcf42255bb Refactor and simplify WaitForPodsRunningReady; update callers to use new interface 2024-04-17 23:18:26 -05:00
Kubernetes Prow Robot
c1fff408c0 Merge pull request #120254 from ionutbalutoiu/windows-tests/conn-check-retries
windows-tests: Add retries to Windows `assertConsistentConnectivity` …
2024-01-17 02:21:38 +01:00
Mark Rossetti
2e8e2989d1 Removing Windows image from e2e test image utils 2024-01-02 15:53:12 -08:00
Patrick Ohly
f2cfbf44b1 e2e: use framework labels
This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.

Arbitrary, custom tags are still left in place for now.
2023-11-01 15:17:34 +01:00
Ionut Balutoiu
8e5b959e12 windows-tests: Add retries to Windows assertConsistentConnectivity func
Add retry logic to the `assertConsistentConnectivity` function from
the `test/e2e/windows/hybrid_network.go` file.

Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
2023-10-30 17:15:05 +02:00
Kubernetes Prow Robot
7658fe8dc4 Merge pull request #118456 from testwill/bool-constant
chore: omit comparison to bool constant
2023-10-26 12:59:05 +02:00
penguin
82c0cbf6d8 e2e: stop using deprecated framework.ExpectNotEqual 2023-10-20 09:18:31 +08:00
Patrick Ohly
f2d34426f8 e2e: enhance SIGDescribe
framework.SIGDescribe is better because:
- Ginkgo uses the source code location of the test, not of the wrapper,
  when reporting progress.
- Additional annotations can be passed.

To make this a drop-in replacement, framework.SIGDescribe generates a function
that can be used instead of the former SIGDescribe functions.

windows.SIGDescribe contained some additional code to ensure that tests are
skipped when not running with a suitable node OS. This gets moved into a
separate wrapper generator, to allow using framework.SIGDescribe as intended.
To ensure that all callers were modified, the windows.sigDescribe isn't
exported anymore (wasn't necessary in the first place!).
2023-10-10 18:15:49 +02:00
Kubernetes Prow Robot
f19b62fc09 Merge pull request #120959 from pohly/e2e-test-whitespace-cleanup
e2e: remove redundant spaces in test names
2023-10-05 00:41:59 +02:00
Mark Rossetti
0b76e7b69f Fixing attempt to deploy past allocatable memory limits test on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2023-09-29 13:26:51 -07:00
Patrick Ohly
0e8a1f1816 e2e: remove redundant spaces in test names
The spaces are redundant because Ginkgo will add them itself when concatenating
the different test name components. Upcoming change in the framework will
enforce that there are no such redundant spaces.
2023-09-29 08:30:57 +02:00
宋文杰
484510863b e2e_windows: stop using deprecated framework.ExpectEqual 2023-08-28 17:04:03 +08:00
guoguangwu
0da37d8c54 chore: omit comparison to bool constant 2023-06-29 10:41:50 +08:00
Kubernetes Prow Robot
2190775b69 Merge pull request #118280 from stlaz/e2e_psa_labels
Set all PSa labels in tests
2023-06-28 11:14:43 -07:00
Patrick Ohly
e7df337eba e2e: replace gomega.Equal(true/false) with gomega.BeTrue/BeFalse()
The failure message becomes a bit nicer. Found by the new ginkgolinter, for
example:

    test/e2e/windows/memory_limits.go:160:2: ginkgo-linter: wrong boolean assertion; consider using `gomega.Eventually(ctx, func() bool {
     eventList, err := f.ClientSet.CoreV1().Events(f.Namespace.Name).List(ctx, metav1.ListOptions{})
     ...
    }, 3*time.Minute, 10*time.Second).Should(gomega.BeTrue())` instead (ginkgolinter)
2023-06-27 14:20:20 +02:00
Stanislav Laznicka
7f532891c9 e2e tests: set all PSa labels instead of just enforcing 2023-06-21 15:05:13 +02:00
Tom Wieczorek
4977189c1b Fix ginkgo noColor deprecation warning
Ginkgo changed the noColor command line arg to be no-color and will
issue the following warning:

You're using deprecated Ginkgo functionality:
=============================================
  --noColor is deprecated, use --no-color instead

Fix this by changing all occurrences accordingly.
2023-06-09 09:34:05 +02:00
Mark Rossetti
5b3510c0b6 Fixing gmsa-webhook install steps for Windows GMSA full tests
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2023-05-31 13:59:02 -07:00
Mark Rossetti
cba8c1f5e2 Fixing windows memory allocation e2e tests after a refactor
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2023-05-22 13:36:21 -07:00
Humble Chirammal
d8e82b1417 e2e: use gomega.Expect instead of framework.ExpectEqual in windows/*
stop using deprecated framework.ExpectEqual

Ref#115961

Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
2023-05-16 16:33:21 +05:30
Ionut Balutoiu
d96f83f02f windows-tests: Update connectivity check util function
Sometimes, the kube-proxy endpoints take longer than 10 seconds to
be ready, so the initial connection check fails (via `gomega.Eventually`).

This patch uses a separate longer timeout for `gomega.Eventually`.

Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
2023-05-02 16:56:09 +03:00
Kubernetes Prow Robot
7529178924 Merge pull request #111372 from HeavenTonight/master
code cleanup
2023-03-10 11:44:40 -08:00
Kubernetes Prow Robot
949bee0118 Merge pull request #116189 from marosset/windows-hyperv-basic-e2e-test
Adding e2e test to verify hyperv container is running inside a VM on Windows
2023-03-01 22:27:07 -08:00
Mark Rossetti
ab020ee628 Adding e2e test to verify hyperv container is running inside a VM on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2023-03-01 14:08:46 -08:00