Commit Graph

3569 Commits

Author SHA1 Message Date
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
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
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
Patrick Ohly
e9193b4f33 e2e: remove dead code for providers
The dead code was found with:

    deadcode -test -filter=k8s.io/kubernetes/test/e2e/framework/... ./test/e2e ./test/e2e_node ./test/e2e_node ./test/e2e_kubeadm

See https://go.dev/blog/deadcode for an introduction.

This removes everything that was reported as dead code for
test/e2e/framework/providers.
2024-02-22 12:42:17 +01:00
Kubernetes Prow Robot
3516bc6f49 Merge pull request #122456 from AxeZhan/beta3960
[KEP 3960]: graduate PodLifecycleSleepAction to beta
2024-02-19 07:44:50 -08:00
AxeZhan
c74ec3df09 graduate PodLifecycleSleepAction to beta 2024-02-19 19:40:52 +08:00
Patrick Ohly
aa772d77fb e2e pod: dump pod in unexpected phase
When stopping polling, the provided messages becomes the complete failure
message. This means that the code which calls gomega.StopTrying must include
the pod in the message instead of just summarizing the phase. This makes the
failure more useful.
2024-02-14 09:01:32 +01:00
bzsuni
658e3308f3 etcd: Update to version 3.5.12
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-02-07 21:16:08 +08:00
carlory
63e91ed023 remove deprecated framework.ExpectNotEqual 2024-02-06 02:53:28 +08:00
Kubernetes Prow Robot
57e9981dc2 Merge pull request #122865 from pohly/e2e-framework-logging
e2e framework: unify logging, support skipping helpers
2024-02-01 09:37:02 -08:00
Kubernetes Prow Robot
7bb00356f0 Merge pull request #122857 from nilo19/chore/cleanup-azure
chore: Cleanup in-tree credential provider azure and cloud provider a…
2024-01-23 21:31:11 +01:00
Patrick Ohly
43539c855f e2e framework: unify logging, support skipping helpers
ginkgo.GinkgoHelper is a recent addition to ginkgo which allows functions to
mark themselves as helper. This then changes which callstack gets reported for
failures. It makes sense to support the same mechanism also for logging.

There's also no reason why framework.Logf should produce output that is in a
different format than klog log entries. Having time stamps formatted
differently makes it hard to read test output which uses a mixture of both.
Another user-visible advantage is that the error log entry from
framework.ExpectNoError now references the test source code.

With textlogger there is a simple replacement for klog that can be reconfigured
to let the caller handle stack unwinding. klog itself doesn't support that
and should be modified to support it (feature freeze).

Emitting printf-style output via that logger would work, but become less
readable because the message string would get quoted instead of printing it
verbatim as before. So instead, the traditional klog header gets reproduced
in the framework code. In this example, the first line is from klog, the second
from Logf:

    I0111 11:00:54.088957  332873 factory.go:193] Registered Plugin "containerd"
    ...
      I0111 11:00:54.987534 332873 util.go:506] >>> kubeConfig: /var/run/kubernetes/admin.kubeconfig

Indention is a bit different because the initial output is printed before
installing the logger which writes through ginkgo.GinkgoWriter.

One welcome side effect is that now "go vet" detects mismatched parameters for
framework.Logf because fmt.Sprintf is called without mangling the format
string. Some of the calls were incorrect.
2024-01-20 18:23:31 +01:00
Patrick Ohly
dd0cee4895 e2e node runner: remove dependency on e2e/framework
A stand-alone binary shouldn't import the test/e2e/framework, which is targeted
towards usage in a Ginkgo test suite. This currently works, but will break once
test/e2e/framework becomes more opinionated about how to configure logging.

The simplest solution is to duplicate the one short function that the binary
was calling in the framework.
2024-01-20 18:23:31 +01:00
Qi Ni
3bf2bf8191 chore: Cleanup in-tree credential provider azure and cloud provider azure 2024-01-20 15:18:31 +08:00
Kubernetes Prow Robot
2d4100335e Merge pull request #122866 from pohly/e2e-klog-fatal
e2e: replace klog.Fatal with assertion
2024-01-19 19:22:14 +01:00
Patrick Ohly
de014579a1 e2e: enforce usage of WithFlaky instead of [Flaky]
Now that we have it (8a89a1f5a5), let's also make sure that
the new WithFlaky is used everywhere instead if [Flaky]. This way it can be
used for filtering by label.
2024-01-19 12:17:37 +01:00
Patrick Ohly
e3ee4e3585 e2e: replace klog.Fatal with assertion
Using klog.Fatal to abort a test leads to a poor user experience because the
output is buffered in ginkgo.GinkgoWriter and not flushed before killing the
process. The output is also different from other failures. Using the normal
error checking is better.

Before:

    $ KUBECONFIG=/no/such/config go test -v ./test/e2e/
      Jan 19 10:06:58.475: INFO: The --provider flag is not set. Continuing as if --provider=skeleton had been used.
    === RUN   TestE2E
      I0119 10:06:58.475844   99472 e2e.go:109] Starting e2e run "5303f626-ae0e-44d7-abf1-b4956d910ef4" on Ginkgo node 1
    Running Suite: Kubernetes e2e suite - /nvme/gopath/src/k8s.io/kubernetes/test/e2e
    =================================================================================
    Random Seed: 1705655217 - will randomize all specs

    Will run 4678 of 7421 specs
    goroutine 817 [running]:
    k8s.io/klog/v2/internal/dbg.Stacks(0x0)
    	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/internal/dbg/dbg.go:35 +0x85
    k8s.io/klog/v2.(*loggingT).output(0x9d92b20, 0x3, 0x0, 0xc00069d7a0, 0x2, {0x834c6e8?, 0x9d91c80?}, 0x300000060?, 0x0)
    ...
    k8s.io/klog/v2.Fatal(...)
    	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1652
    k8s.io/kubernetes/test/e2e.setupSuite({0x7fb49064c078, 0xc003072360})
    	/nvme/gopath/src/k8s.io/kubernetes/test/e2e/e2e.go:187 +0x125
    ...
    FAIL	k8s.io/kubernetes/test/e2e	0.759s
    FAIL

After:

    $ KUBECONFIG=/no/such/config go test -v ./test/e2e/
      Jan 19 10:12:58.889: INFO: The --provider flag is not set. Continuing as if --provider=skeleton had been used.
    === RUN   TestE2E
      I0119 10:12:58.889224  106019 e2e.go:109] Starting e2e run "bed5a77a-f595-42d0-b512-5f601067444b" on Ginkgo node 1
    Running Suite: Kubernetes e2e suite - /nvme/gopath/src/k8s.io/kubernetes/test/e2e
    =================================================================================
    Random Seed: 1705655578 - will randomize all specs

    Will run 4678 of 7421 specs
    ------------------------------
    [SynchronizedBeforeSuite] [FAILED] [0.001 seconds]
    [SynchronizedBeforeSuite]
    /nvme/gopath/src/k8s.io/kubernetes/test/e2e/e2e.go:69

      Timeline >>
      Jan 19 10:12:59.063: INFO: >>> kubeConfig: /no/such/config
      Jan 19 10:12:59.063: INFO: Unexpected error: Error loading client:
          <*errors.errorString | 0xc00182c130>:
          error creating client: error loading KubeConfig: open /no/such/config: no such file or directory
          {
              s: "error creating client: error loading KubeConfig: open /no/such/config: no such file or directory",
          }
      [FAILED] in [SynchronizedBeforeSuite] - /nvme/gopath/src/k8s.io/kubernetes/test/e2e/e2e.go:186 @ 01/19/24 10:12:59.064
      << Timeline

      [FAILED] Error loading client: error creating client: error loading KubeConfig: open /no/such/config: no such file or directory
      In [SynchronizedBeforeSuite] at: /nvme/gopath/src/k8s.io/kubernetes/test/e2e/e2e.go:186 @ 01/19/24 10:12:59.064
    ------------------------------

    Summarizing 1 Failure:
      [FAIL] [SynchronizedBeforeSuite]
      /nvme/gopath/src/k8s.io/kubernetes/test/e2e/e2e.go:186

    Ran 0 of 7421 Specs in 0.001 seconds
    FAIL! -- A BeforeSuite node failed so all tests were skipped.
    --- FAIL: TestE2E (0.18s)
    FAIL
    FAIL	k8s.io/kubernetes/test/e2e	0.769s
    FAIL
2024-01-19 10:14:07 +01:00
Kubernetes Prow Robot
afb1523bf4 Merge pull request #122833 from kannon92/add-density-test-flake
mark density tests as flaky
2024-01-18 19:03:11 +01:00
Kevin Hannon
8a89a1f5a5 mark density tests as flaky 2024-01-18 09:50:39 -05:00
Patrick Ohly
3aa366a3eb e2e: remove dead code
The dead code was found with:

    deadcode -test -filter=k8s.io/kubernetes/test/e2e/framework/... ./test/e2e ./test/e2e_node ./test/e2e_node ./test/e2e_kubeadm

See https://go.dev/blog/deadcode for an introduction.

Only dead code which is clearly not needed anymore (glog logging),
questionable (skipping based on feature gates) or
redundant (WaitForPodSuccessInNamespaceSlow) gets removed for now. More
removals might make sense in the future.
2024-01-17 12:57:35 +01:00
Kubernetes Prow Robot
c9158e9a19 Merge pull request #122595 from dims/support-building-with-and-without-cloud-providers
KUBE_PROVIDERLESS - Support building with and without cloud providers
2024-01-11 05:42:23 +01:00
Kubernetes Prow Robot
c8a718bb87 Merge pull request #121916 from carlory/issue-121892
E2E - Sig-autoscaling: Refactor the Autoscaling utils
2024-01-08 17:30:08 +01:00
Maciej Szulik
67cf648ab7 Add a new neverTerminate job behavior just for upgrade 2024-01-08 13:51:08 +01:00