File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
29
29
"github.com/digitalocean/godo"
30
30
"github.com/kubernetes-csi/csi-test/pkg/sanity"
31
31
"github.com/sirupsen/logrus"
32
+ "golang.org/x/sync/errgroup"
32
33
)
33
34
34
35
func init () {
@@ -83,22 +84,23 @@ func TestDriverSuite(t *testing.T) {
83
84
}
84
85
85
86
ctx , cancel := context .WithCancel (context .Background ())
86
- defer cancel ()
87
87
88
- go func () {
89
- err := driver .Run (ctx )
90
- if err != nil {
91
- t .Error (err )
92
- }
93
- }()
88
+ var eg errgroup.Group
89
+ eg .Go (func () error {
90
+ return driver .Run (ctx )
91
+ })
94
92
95
93
cfg := & sanity.Config {
96
94
TargetPath : os .TempDir () + "/csi-target" ,
97
95
StagingPath : os .TempDir () + "/csi-staging" ,
98
96
Address : endpoint ,
99
97
}
100
-
101
98
sanity .Test (t , cfg )
99
+
100
+ cancel ()
101
+ if err := eg .Wait (); err != nil {
102
+ t .Errorf ("driver run failed: %s" , err )
103
+ }
102
104
}
103
105
104
106
type fakeAccountDriver struct {
You can’t perform that action at this time.
0 commit comments