Shorten watch restart test, run in parallel

This commit is contained in:
Jordan Liggitt 2020-07-23 17:17:29 -04:00
parent 04ecdb9eb6
commit c778008420

View File

@ -64,7 +64,7 @@ func noop() {}
func TestWatchRestartsIfTimeoutNotReached(t *testing.T) { func TestWatchRestartsIfTimeoutNotReached(t *testing.T) {
// Has to be longer than 5 seconds // Has to be longer than 5 seconds
timeout := 2 * time.Minute timeout := 30 * time.Second
// Set up a master // Set up a master
masterConfig := framework.NewIntegrationTestMasterConfig() masterConfig := framework.NewIntegrationTestMasterConfig()
@ -204,9 +204,11 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) {
}, },
} }
t.Run("group", func(t *testing.T) {
for _, tmptc := range tt { for _, tmptc := range tt {
tc := tmptc // we need to copy it for parallel runs tc := tmptc // we need to copy it for parallel runs
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
t.Parallel()
c, err := kubernetes.NewForConfig(config) c, err := kubernetes.NewForConfig(config)
if err != nil { if err != nil {
t.Fatalf("Failed to create clientset: %v", err) t.Fatalf("Failed to create clientset: %v", err)
@ -271,4 +273,5 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) {
} }
}) })
} }
})
} }