Skip to content

Commit

Permalink
UPSTREAM: <carry>: Extend default unit test timeout to 180s
Browse files Browse the repository at this point in the history
The following packages have tests that exceed the default 120s
timeout:

k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler

 - The tests in this package collectively take longer than 120s.

k8s.io/kubernetes/pkg/volume/csi

 - One of the unit tests has to wait 2 minutes for a timeout to
   validate its failure condition.
  • Loading branch information
marun authored and soltysh committed Sep 8, 2021
1 parent 6b48cf5 commit 0873fc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hack/make-rules/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ kube::test::find_dirs() {
)
}

KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout=120s}
# The default timeout of 120s is not sufficient for the following packages
# whose successful execution takes longer than that.
# - k8s.io/kubernetes/pkg/kubelet/volumemanager/reconciler
# - k8s.io/kubernetes/pkg/volume/csi
KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout=180s}
KUBE_COVER=${KUBE_COVER:-n} # set to 'y' to enable coverage collection
KUBE_COVERMODE=${KUBE_COVERMODE:-atomic}
# The directory to save test coverage reports to, if generating them. If unset,
Expand Down
7 changes: 7 additions & 0 deletions pkg/volume/csi/csi_attacher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,13 @@ func TestAttacherDetach(t *testing.T) {
return false, nil, nil
},
},
// The watcher error triggered by this test case will result in the
// Detach() call on L984 timing out after 2 minutes since an error
// condition is logged but not returned. Thus this test will only pass if
// the default value for KUBE_TEST_TIMEOUT in hack/make-rules/test.sh is
// greater than the default of 120s. It's not clear why this test was
// merged at all given that a watcher error is only logged and cannot be
// observed by the test.
{
name: "API watch error happen",
volID: "vol-005",
Expand Down

0 comments on commit 0873fc9

Please sign in to comment.