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:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package e2enode
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -171,7 +172,7 @@ var _ = SIGDescribe("Node Performance Testing [Serial] [Slow]", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
wl = workloads.NodePerfWorkloads[0]
|
||||
})
|
||||
ginkgo.It("NAS parallel benchmark (NPB) suite - Integer Sort (IS) workload", func() {
|
||||
ginkgo.It("NAS parallel benchmark (NPB) suite - Integer Sort (IS) workload", func(ctx context.Context) {
|
||||
defer cleanup()
|
||||
runWorkload()
|
||||
})
|
||||
@@ -180,7 +181,7 @@ var _ = SIGDescribe("Node Performance Testing [Serial] [Slow]", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
wl = workloads.NodePerfWorkloads[1]
|
||||
})
|
||||
ginkgo.It("NAS parallel benchmark (NPB) suite - Embarrassingly Parallel (EP) workload", func() {
|
||||
ginkgo.It("NAS parallel benchmark (NPB) suite - Embarrassingly Parallel (EP) workload", func(ctx context.Context) {
|
||||
defer cleanup()
|
||||
runWorkload()
|
||||
})
|
||||
@@ -189,7 +190,7 @@ var _ = SIGDescribe("Node Performance Testing [Serial] [Slow]", func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
wl = workloads.NodePerfWorkloads[2]
|
||||
})
|
||||
ginkgo.It("TensorFlow workload", func() {
|
||||
ginkgo.It("TensorFlow workload", func(ctx context.Context) {
|
||||
defer cleanup()
|
||||
runWorkload()
|
||||
})
|
||||
|
Reference in New Issue
Block a user