Skip to content

Commit 7bff39b

Browse files
committed
Remove It specific timeout
1 parent a98ffc0 commit 7bff39b

File tree

7 files changed

+54
-56
lines changed

7 files changed

+54
-56
lines changed

pkg/builder/controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ var _ = Describe("application", func() {
319319
ctx, cancel := context.WithCancel(context.Background())
320320
defer cancel()
321321
doReconcileTest(ctx, "3", m, false, bldr)
322-
}, 10)
322+
})
323323

324324
It("should Reconcile Watches objects", func() {
325325
m, err := manager.New(cfg, manager.Options{})
@@ -334,7 +334,7 @@ var _ = Describe("application", func() {
334334
ctx, cancel := context.WithCancel(context.Background())
335335
defer cancel()
336336
doReconcileTest(ctx, "4", m, true, bldr)
337-
}, 10)
337+
})
338338
})
339339

340340
Describe("Set custom predicates", func() {

pkg/cache/cache_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
12881288

12891289
By("verifying the object is received on the channel")
12901290
Eventually(out).Should(Receive(Equal(pod)))
1291-
}, 3)
1291+
})
12921292

12931293
It("should be able to index an object field then retrieve objects by that field", func() {
12941294
By("creating the cache")
@@ -1338,7 +1338,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
13381338
Expect(listObj.Items).Should(HaveLen(1))
13391339
actual := listObj.Items[0]
13401340
Expect(actual.GetName()).To(Equal("test-pod-3"))
1341-
}, 3)
1341+
})
13421342

13431343
It("should allow for get informer to be cancelled", func() {
13441344
By("cancelling the context")
@@ -1408,7 +1408,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
14081408

14091409
By("verifying the object's metadata is received on the channel")
14101410
Eventually(out).Should(Receive(Equal(podMeta)))
1411-
}, 3)
1411+
})
14121412

14131413
It("should be able to index an object field then retrieve objects by that field", func() {
14141414
By("creating the cache")
@@ -1462,7 +1462,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
14621462
Version: "v1",
14631463
Kind: "Pod",
14641464
}))
1465-
}, 3)
1465+
})
14661466

14671467
It("should allow for get informer to be cancelled", func() {
14681468
By("creating a context and cancelling it")

pkg/client/client_test.go

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ import (
3838
"sigs.k8s.io/controller-runtime/pkg/client"
3939
)
4040

41-
const serverSideTimeoutSeconds = 10
42-
4341
func deleteDeployment(ctx context.Context, dep *appsv1.Deployment, ns string) {
4442
_, err := clientset.AppsV1().Deployments(ns).Get(ctx, dep.Name, metav1.GetOptions{})
4543
if err == nil {
@@ -167,7 +165,7 @@ var _ = Describe("Client", func() {
167165
Spec: corev1.NodeSpec{},
168166
}
169167
scheme = kscheme.Scheme
170-
}, serverSideTimeoutSeconds)
168+
})
171169

172170
var delOptions *metav1.DeleteOptions
173171
AfterEach(func() {
@@ -184,7 +182,7 @@ var _ = Describe("Client", func() {
184182
err = clientset.CoreV1().Nodes().Delete(ctx, node.Name, *delOptions)
185183
Expect(err).NotTo(HaveOccurred())
186184
}
187-
}, serverSideTimeoutSeconds)
185+
})
188186

189187
// TODO(seans): Cast "cl" as "client" struct from "Client" interface. Then validate the
190188
// instance values for the "client" struct.
@@ -294,7 +292,7 @@ var _ = Describe("Client", func() {
294292
Expect(err).To(HaveOccurred())
295293
// TODO(seans): Add test to validate the returned error. Problems currently with
296294
// different returned error locally versus travis.
297-
}, serverSideTimeoutSeconds)
295+
})
298296

299297
It("should fail if the object cannot be mapped to a GVK", func() {
300298
By("creating client with empty Scheme")
@@ -431,7 +429,7 @@ var _ = Describe("Client", func() {
431429
Expect(err).To(HaveOccurred())
432430
// TODO(seans): Add test to validate the returned error. Problems currently with
433431
// different returned error locally versus travis.
434-
}, serverSideTimeoutSeconds)
432+
})
435433

436434
})
437435

@@ -1646,7 +1644,7 @@ var _ = Describe("Client", func() {
16461644
}
16471645
}
16481646
Expect(hasDep).To(BeTrue())
1649-
}, serverSideTimeoutSeconds)
1647+
})
16501648

16511649
It("should fetch unstructured collection of objects", func() {
16521650
By("create an initial object")
@@ -1680,7 +1678,7 @@ var _ = Describe("Client", func() {
16801678
}
16811679
}
16821680
Expect(hasDep).To(BeTrue())
1683-
}, serverSideTimeoutSeconds)
1681+
})
16841682

16851683
It("should fetch unstructured collection of objects, even if scheme is empty", func() {
16861684
By("create an initial object")
@@ -1709,7 +1707,7 @@ var _ = Describe("Client", func() {
17091707
}
17101708
}
17111709
Expect(hasDep).To(BeTrue())
1712-
}, serverSideTimeoutSeconds)
1710+
})
17131711

17141712
It("should return an empty list if there are no matching objects", func() {
17151713
cl, err := client.New(cfg, client.Options{})
@@ -1721,7 +1719,7 @@ var _ = Describe("Client", func() {
17211719

17221720
By("validating no Deployments are returned")
17231721
Expect(deps.Items).To(BeEmpty())
1724-
}, serverSideTimeoutSeconds)
1722+
})
17251723

17261724
// TODO(seans): get label selector test working
17271725
It("should filter results by label selector", func() {
@@ -1782,7 +1780,7 @@ var _ = Describe("Client", func() {
17821780

17831781
deleteDeployment(ctx, depFrontend, ns)
17841782
deleteDeployment(ctx, depBackend, ns)
1785-
}, serverSideTimeoutSeconds)
1783+
})
17861784

17871785
It("should filter results by namespace selector", func() {
17881786
By("creating a Deployment in test-namespace-1")
@@ -1841,7 +1839,7 @@ var _ = Describe("Client", func() {
18411839
deleteDeployment(ctx, depBackend, "test-namespace-2")
18421840
deleteNamespace(ctx, tns1)
18431841
deleteNamespace(ctx, tns2)
1844-
}, serverSideTimeoutSeconds)
1842+
})
18451843

18461844
It("should filter results by field selector", func() {
18471845
By("creating a Deployment with name deployment-frontend")
@@ -1893,7 +1891,7 @@ var _ = Describe("Client", func() {
18931891

18941892
deleteDeployment(ctx, depFrontend, ns)
18951893
deleteDeployment(ctx, depBackend, ns)
1896-
}, serverSideTimeoutSeconds)
1894+
})
18971895

18981896
It("should filter results by namespace selector and label selector", func() {
18991897
By("creating a Deployment in test-namespace-3 with the app=frontend label")
@@ -1986,7 +1984,7 @@ var _ = Describe("Client", func() {
19861984
deleteDeployment(ctx, depFrontend4, "test-namespace-4")
19871985
deleteNamespace(ctx, tns3)
19881986
deleteNamespace(ctx, tns4)
1989-
}, serverSideTimeoutSeconds)
1987+
})
19901988

19911989
It("should filter results using limit and continue options", func() {
19921990

@@ -2069,7 +2067,7 @@ var _ = Describe("Client", func() {
20692067
Expect(deps.Continue).To(BeEmpty())
20702068
Expect(deps.Items[0].Name).To(Equal(dep3.Name))
20712069
Expect(deps.Items[1].Name).To(Equal(dep4.Name))
2072-
}, serverSideTimeoutSeconds)
2070+
})
20732071

20742072
PIt("should fail if the object doesn't have meta", func() {
20752073

@@ -2112,7 +2110,7 @@ var _ = Describe("Client", func() {
21122110
}
21132111
}
21142112
Expect(hasDep).To(BeTrue())
2115-
}, serverSideTimeoutSeconds)
2113+
})
21162114

21172115
It("should return an empty list if there are no matching objects", func() {
21182116
cl, err := client.New(cfg, client.Options{})
@@ -2129,7 +2127,7 @@ var _ = Describe("Client", func() {
21292127

21302128
By("validating no Deployments are returned")
21312129
Expect(deps.Items).To(BeEmpty())
2132-
}, serverSideTimeoutSeconds)
2130+
})
21332131

21342132
It("should filter results by namespace selector", func() {
21352133
By("creating a Deployment in test-namespace-5")
@@ -2193,7 +2191,7 @@ var _ = Describe("Client", func() {
21932191
deleteDeployment(ctx, depBackend, "test-namespace-6")
21942192
deleteNamespace(ctx, tns1)
21952193
deleteNamespace(ctx, tns2)
2196-
}, serverSideTimeoutSeconds)
2194+
})
21972195

21982196
It("should filter results by field selector", func() {
21992197
By("creating a Deployment with name deployment-frontend")
@@ -2250,7 +2248,7 @@ var _ = Describe("Client", func() {
22502248

22512249
deleteDeployment(ctx, depFrontend, ns)
22522250
deleteDeployment(ctx, depBackend, ns)
2253-
}, serverSideTimeoutSeconds)
2251+
})
22542252

22552253
It("should filter results by namespace selector and label selector", func() {
22562254
By("creating a Deployment in test-namespace-7 with the app=frontend label")
@@ -2346,7 +2344,7 @@ var _ = Describe("Client", func() {
23462344
deleteDeployment(ctx, depFrontend4, "test-namespace-8")
23472345
deleteNamespace(ctx, tns3)
23482346
deleteNamespace(ctx, tns4)
2349-
}, serverSideTimeoutSeconds)
2347+
})
23502348

23512349
PIt("should fail if the object doesn't have meta", func() {
23522350

@@ -2394,7 +2392,7 @@ var _ = Describe("Client", func() {
23942392
}
23952393
}
23962394
Expect(hasDep).To(BeTrue())
2397-
}, serverSideTimeoutSeconds)
2395+
})
23982396

23992397
It("should return an empty list if there are no matching objects", func() {
24002398
cl, err := client.New(cfg, client.Options{})
@@ -2411,7 +2409,7 @@ var _ = Describe("Client", func() {
24112409

24122410
By("validating no Deployments are returned")
24132411
Expect(metaList.Items).To(BeEmpty())
2414-
}, serverSideTimeoutSeconds)
2412+
})
24152413

24162414
// TODO(seans): get label selector test working
24172415
It("should filter results by label selector", func() {
@@ -2477,7 +2475,7 @@ var _ = Describe("Client", func() {
24772475

24782476
deleteDeployment(ctx, depFrontend, ns)
24792477
deleteDeployment(ctx, depBackend, ns)
2480-
}, serverSideTimeoutSeconds)
2478+
})
24812479

24822480
It("should filter results by namespace selector", func() {
24832481
By("creating a Deployment in test-namespace-1")
@@ -2541,7 +2539,7 @@ var _ = Describe("Client", func() {
25412539
deleteDeployment(ctx, depBackend, "test-namespace-2")
25422540
deleteNamespace(ctx, tns1)
25432541
deleteNamespace(ctx, tns2)
2544-
}, serverSideTimeoutSeconds)
2542+
})
25452543

25462544
It("should filter results by field selector", func() {
25472545
By("creating a Deployment with name deployment-frontend")
@@ -2598,7 +2596,7 @@ var _ = Describe("Client", func() {
25982596

25992597
deleteDeployment(ctx, depFrontend, ns)
26002598
deleteDeployment(ctx, depBackend, ns)
2601-
}, serverSideTimeoutSeconds)
2599+
})
26022600

26032601
It("should filter results by namespace selector and label selector", func() {
26042602
By("creating a Deployment in test-namespace-3 with the app=frontend label")
@@ -2696,7 +2694,7 @@ var _ = Describe("Client", func() {
26962694
deleteDeployment(ctx, depFrontend4, "test-namespace-4")
26972695
deleteNamespace(ctx, tns3)
26982696
deleteNamespace(ctx, tns4)
2699-
}, serverSideTimeoutSeconds)
2697+
})
27002698

27012699
It("should filter results using limit and continue options", func() {
27022700

@@ -2794,7 +2792,7 @@ var _ = Describe("Client", func() {
27942792
Expect(metaList.Continue).To(BeEmpty())
27952793
Expect(metaList.Items[0].Name).To(Equal(dep3.Name))
27962794
Expect(metaList.Items[1].Name).To(Equal(dep4.Name))
2797-
}, serverSideTimeoutSeconds)
2795+
})
27982796

27992797
PIt("should fail if the object doesn't have meta", func() {
28002798

pkg/client/watch_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ var _ = Describe("ClientWithWatch", func() {
5959
var err error
6060
dep, err = clientset.AppsV1().Deployments(ns).Create(ctx, dep, metav1.CreateOptions{})
6161
Expect(err).NotTo(HaveOccurred())
62-
}, serverSideTimeoutSeconds)
62+
})
6363

6464
AfterEach(func() {
6565
deleteDeployment(ctx, dep, ns)
66-
}, serverSideTimeoutSeconds)
66+
})
6767

6868
Describe("NewWithWatch", func() {
6969
It("should return a new Client", func() {
@@ -103,7 +103,7 @@ var _ = Describe("ClientWithWatch", func() {
103103

104104
It("should receive a create event when watching the typed object", func() {
105105
watchSuite(&appsv1.DeploymentList{}, &appsv1.Deployment{})
106-
}, 15)
106+
})
107107

108108
It("should receive a create event when watching the unstructured object", func() {
109109
u := &unstructured.UnstructuredList{}
@@ -113,12 +113,12 @@ var _ = Describe("ClientWithWatch", func() {
113113
Version: "v1",
114114
})
115115
watchSuite(u, &unstructured.Unstructured{})
116-
}, 15)
116+
})
117117

118118
It("should receive a create event when watching the metadata object", func() {
119119
m := &metav1.PartialObjectMetadataList{TypeMeta: metav1.TypeMeta{Kind: "Deployment", APIVersion: "apps/v1"}}
120120
watchSuite(m, &metav1.PartialObjectMetadata{})
121-
}, 15)
121+
})
122122
})
123123

124124
})

pkg/controller/controller_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ var _ = Describe("controller", func() {
169169
err = cm.GetClient().
170170
List(context.Background(), &controllertest.UnconventionalListTypeList{})
171171
Expect(err).NotTo(HaveOccurred())
172-
}, 5)
172+
})
173173
})
174174
})
175175

0 commit comments

Comments
 (0)