Commit Graph

3589 Commits

Author SHA1 Message Date
Michal Wozniak
2d680054c1 Format helper scripts in Job e2e tests as multiline for readability 2024-07-18 11:05:36 +02:00
Antonio Ojea
93736f268e use node.status.addresses to obtain hostnetwork pods hostnames 2024-07-14 19:02:14 +00:00
Michal Wozniak
f999dd0490 Verify the Job status active, ready and terminating are 0
Signed-off-by: Michal Wozniak <michalwozniak@google.com>
2024-07-11 20:54:15 +02:00
Patrick Ohly
4bed71dd15 e2e framework: don't add default skip when --label-filter is used
The new pull-kubernetes-kind-dra uses
    -label-filter='Feature: containsAny DynamicResourceAllocation && !Flaky && !Serial'
to run DRA tests. That didn't work because the E2E framework behind its back
added the default skip expression.
2024-07-08 21:13:52 +02:00
Daman Arora
6605afe58a e2e/network/lb: fix url formatting for ipv6
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-07-03 20:48:54 +05:30
Kubernetes Prow Robot
2e39a55d49 Merge pull request #125794 from bzsuni/cleanup/PollImmediateWithContext
Use PollUntilContextTimeout to replace PollImmediateWithContext
2024-07-01 00:13:05 -07:00
Matthieu MOREL
7bccbaf996 fix: enable and fixes rules from testifylint on test package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-30 05:44:47 +00:00
bzsuni
1599658fc6 Use PollUntilContextTimeout to replace PollImmediateWithContext
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-06-29 18:50:34 +08:00
yintong.huang
2db1b321e0 drop deprecated PollWithContext and adopt PollUntilContextTimeout instead
Signed-off-by: yintong.huang <yintong.huang@daocloud.io>
2024-06-21 19:23:31 +08:00
Kubernetes Prow Robot
debd99542f Merge pull request #125478 from aroradaman/handle-index-error
e2e/framework/metrics: handle index out of bounds panic
2024-06-16 12:46:29 -07:00
Kubernetes Prow Robot
9de747cc01 Merge pull request #125434 from ffromani/e2e-node-annotate-pods
e2e: node: add feature to annotate pods with owning code
2024-06-16 04:27:28 -07:00
Daman Arora
9fd1a21693 e2e/framework/metrics: handle index out of bounds panic
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-06-15 00:42:11 +05:30
Francesco Romani
7160ef4fbc e2e: node: add code to track the pod creator code
e2e_node test depend on very specific shared state (node state).
Pod leakages between tests oftentimes cause the test preconditions
to be silently corrupted, causing hard to debug CI failures.

We add the option to add an annotation to pods which records
the code line (source code:line) which triggered the pod creation,
so it becomes easier to track which test needs better cleanup.

The relevant e2e framework code is used in all the e2e suites,
so to minimize any unwanted consequences we make the feature
opt-in, planning to enable it initially (and likely only)
in the e2e_node tests.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2024-06-14 13:42:14 +02:00
Kubernetes Prow Robot
58e15c831c Merge pull request #125431 from huww98/e2e-term-sleep
e2e: add TERM trap to pod sleep command
2024-06-12 02:35:29 -07:00
Kubernetes Prow Robot
d593c886b1 Merge pull request #124350 from pohly/e2e-feature-labels
e2e: enhance WithFeatureGate labels
2024-06-11 13:02:02 -07:00
胡玮文
859bd02593 e2e: add TERM trap to pod sleep command
This should avoid the 30s delay caused by shell not responding to SIGTERM, and can only be killed by SIGKILL.

If the pod is deleted with the namespace during cleanup, this also makes cleanup faster, and frees up the resources for the next test cases faster.
2024-06-11 13:52:47 +08:00
Connor Catlett
ea58abfd99 Add Happy Path VolumeAttributesClass CSI E2E Tests
Signed-off-by: Connor Catlett <conncatl@amazon.com>
2024-06-10 20:03:54 +00:00
Kubernetes Prow Robot
e67f889edc Merge pull request #125015 from aroradaman/proxy-localhost-nodeports-metric
Kube-Proxy: Track packets accepted on localhost nodeports
2024-06-04 18:49:11 -07:00
Dan Winship
b82bc5d935 Log namespace of pods in e2e failure debug 2024-05-31 09:14:58 -04:00
Stephen Kitt
5300466a5c Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-05-28 10:48:22 +02:00
Daman Arora
9b9a3d780e test/e2e: add kube-proxy metrics grabber
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-05-21 22:41:23 +05:30
Itamar Holder
13403e836a Fix swap feature gate check by introduting IsFeatureGateEnabled()
Signed-off-by: Itamar Holder <iholder@redhat.com>
2024-05-21 11:19:54 +03:00
Kubernetes Prow Robot
b8c4e12a17 Merge pull request #120301 from liyuerich/storage
e2e_storage:stop using deprecated framework.ExpectError
2024-05-16 02:38:12 -07:00
Daman Arora
3f2deb51ad e2e/network: dump iptables and conntrack flows for debugging
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-05-14 15:22:17 +05:30
liyuerich
f55588fa0b e2e_storage:stop using deprecated framework.ExpectError
Signed-off-by: liyuerich <yue.li@daocloud.io>
2024-05-09 18:10:33 +08:00
carlory
522c06b542 add e2e test for HonorPVReclaimPolicy 2024-05-09 01:19:45 +08:00
Antonio Ojea
9239e44950 dump not network information on e2e failures 2024-05-07 21:22:11 +00:00
Davanum Srinivas
bf268f02a3 Remove gcp in-tree cloud provider and credential provider
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-01 09:03:53 -04:00
Daman Arora
20d335a94c e2e/framework network: exit early in DialFromContainer
Immediately exit on receiving an unexpected response, we currently
wait for all the attempts to be exhausted and then return an error.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-04-27 22:55:35 +05:30
Justyna Betkier
a484bb94c2 Fix linter issues 2024-04-25 13:34:30 +02:00
Justyna Betkier
8ba3327de7 Append both env variables instead of fetching twice and overriding them.
Previously the second line would fetch the clean environment variables
and drop the changes from the first line.
2024-04-25 13:34:30 +02:00
Antonio Ojea
06457a5219 don't force delete pods on e2e tests 2024-04-23 11:56:44 +00: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
Kubernetes Prow Robot
5e229a02d3 Merge pull request #124185 from aojea/e2e_stress_remotecommand
e2e test to execute 1000 times in a container with concurrency 10
2024-04-19 05:17:57 -07:00
Kubernetes Prow Robot
1d171a7501 Merge pull request #124289 from pohly/test-e2e-node-verbosity-fix
e2e node: fix -v support
2024-04-18 04:24:23 -07:00
Filip Křepinský
85d55b6737 fix stateful set pod recreation and event spam (#123809)
* fix pods tracking and internal error checking in statefulset tests

* fix stateful set pod recreation and event spam

- do not emit events when pod reaches terminal phase
- do not try to recreate pod until the old pod has been removed from
  etcd storage

* fix conflict race in statefulset rest update

statefulset controller does less requests per sync now and thus can
reconcile status faster, thus resulting in a higher chance for conflicts
2024-04-18 01:03:46 -07:00
Patrick Ohly
c57be6f7f5 e2e framework: clarify Alpha/Beta requirement for feature gates
We want:

- To keep test annotations simple, using both WithFeatureGate
  and WithFeature should only be necessary when a test really
  has requirements that go beyond "feature gate needs to be enabled".

- To run tests which depend only on feature gates being enabled
  in the ci-kubernetes-e2e-kind-alpha-features resp.
  ci-kubernetes-e2e-kind-beta-features, because otherwise we
  may have a proliferation of many bespoke jobs which only run
  very few tests. This would make testing more expensive for
  Kubernetes.

- To enable those tests only once in the ci-kubernetes-e2e-kind-alpha-features
  and ci-kubernetes-e2e-kind-beta-features definition instead
  of having to update those each time feature gates change.

This can be achieved by adding `Feature:Alpha` resp. `Feature:Beta` as Ginkgo
labels instead of just `Alpha` and `Beta`. Then jobs which are configured to
skip tests with feature dependencies via --label-filter=!/Feature:.+/ will skip
tests which are labeled with just WithFeatureGate. The ci-kubernetes jobs
can select to include such tests with a special regexp that mimicks
a negative lookahead (see k8s.io/community/contributors/devel/sig-testing/e2e-tests.md)

Note that removing WithFeature depends on first updating job definitions to use
--label-filter or to skip based on the inline `[Alpha]` or `[Beta]` text,
otherwise tests that were previously skipped because of WithFeature might
start to run in jobs which don't have the feature gate enabled.
2024-04-18 07:48:21 +02:00
Matt Karrmann
5b3f48d263 Revert check at end of WaitForAlmostAllPodsReady to only consider Pending pods 2024-04-17 23:18:26 -05:00
Matt Karrmann
62b9e832cc Small clean and comment rewording of WaitForPodsRunningReady 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
Matt Karrmann
fcdf67a815 Add WaitForAlmostAllPodsReady function, similar to previous WaitForPodsRunningReady function 2024-04-17 23:18:26 -05:00
Matt Karrmann
fe251cb737 Explicitity set contract for WaitForPodsRunningReady, and rewrite accordingly 2024-04-17 23:18:26 -05:00
Matt Karrmann
2537c10453 Improve logging and comments in WaitForPodsRunningReady 2024-04-17 23:18:26 -05:00
Matt Karrmann
273cd03c01 Cleanup WaitForPodsRunningReady: fail for bad pods and reword log message 2024-04-17 23:18:26 -05:00
Patrick Ohly
feb27b9907 e2e framework: configure Ginkgo logger and klog consistently
Even if the textlogger which writes to Ginkgo is installed as the logger in
klog, klog still does some verbosity checks itself (for example,
klog.V().Enabled).

Therefore the framework has to keep the verbosity settings in the textlogger
and in klog consistent. This is done by wrapping the Set call instead of
replacing it.
2024-04-15 10:10:56 +02:00
Antonio Ojea
f81cce61e6 e2e test to execute 1000 times in a container
with concurrency 10

Change-Id: Idf9aa8e22e62e718993ea82b23e1818e34556315
2024-04-07 19:34:40 +00:00
Tim Allclair
207a965b3f Update AppArmor e2e tests 2024-03-05 12:22:50 -08:00
huweiwen
c2ccb921ea e2e pod: fail fast on failed pod
no need to wait until timeout. reduce test time
2024-03-04 00:01:02 +08:00
Kubernetes Prow Robot
a54d84d17f Merge pull request #123138 from carlory/remove-ExpectNotEqual
remove deprecated framework.ExpectNotEqual
2024-02-23 02:57:09 -08:00