Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit 98a694e

Browse files
Random-Liuchavafg
authored andcommitted
Fix integration test for golang 1.13
Signed-off-by: Lantao Liu <[email protected]>
1 parent 50b9e10 commit 98a694e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"flag"
2323
"fmt"
2424
"net"
25+
"os"
2526
"os/exec"
2627
"strconv"
2728
"strings"
@@ -63,11 +64,12 @@ var criRoot = flag.String("cri-root", "/var/lib/containerd/io.containerd.grpc.v1
6364
var runtimeHandler = flag.String("runtime-handler", "", "The runtime handler to use in the test.")
6465
var containerdBin = flag.String("containerd-bin", "containerd", "The containerd binary name. The name is used to restart containerd during test.")
6566

66-
func init() {
67+
func TestMain(m *testing.M) {
6768
flag.Parse()
6869
if err := ConnectDaemons(); err != nil {
6970
logrus.WithError(err).Fatalf("Failed to connect daemons")
7071
}
72+
os.Exit(m.Run())
7173
}
7274

7375
// ConnectDaemons connect cri plugin and containerd, and initialize the clients.

0 commit comments

Comments
 (0)