mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
e2e: accept context from Ginkgo
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.
This is a first automated step towards that: the additional parameter got added
with
sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
$(git grep -l -e framework.ConformanceIt -e ginkgo.It )
$GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')
log_test.go was left unchanged.
This commit is contained in:
@@ -75,7 +75,7 @@ var _ = common.SIGDescribe("ClusterDns [Feature:Example]", func() {
|
||||
return string(data)
|
||||
}
|
||||
|
||||
ginkgo.It("should create pod that uses dns", func() {
|
||||
ginkgo.It("should create pod that uses dns", func(ctx context.Context) {
|
||||
// contrary to the example, this test does not use contexts, for simplicity
|
||||
// namespaces are passed directly.
|
||||
// Also, for simplicity, we don't use yamls with namespaces, but we
|
||||
|
||||
Reference in New Issue
Block a user