fix test timeouts
diff --git a/apigeeSync_suite_test.go b/apigeeSync_suite_test.go index 92bff57..9e6ed94 100644 --- a/apigeeSync_suite_test.go +++ b/apigeeSync_suite_test.go
@@ -27,7 +27,7 @@ var _ = BeforeSuite(func() { wipeDBAferTest = true -}, 3) +}) var _ = BeforeEach(func(done Done) { apid.Initialize(factory.DefaultServicesFactory())
diff --git a/apigee_sync_test.go b/apigee_sync_test.go index 697b94f..5d56a49 100644 --- a/apigee_sync_test.go +++ b/apigee_sync_test.go
@@ -155,7 +155,7 @@ } pie.Plugins = append(pie.Plugins, pluginData) postInitPlugins(pie) - }) + }, 3) It("should bootstrap from local DB if present", func(done Done) { @@ -196,7 +196,7 @@ pie.Plugins = append(pie.Plugins, pluginData) postInitPlugins(pie) - }) + }, 3) It("should correctly identify non-proper subsets with respect to maps", func() { @@ -237,7 +237,7 @@ Expect(changesHaveNewTables(nil, []common.Change{common.Change{Table: "a"}}, )).To(BeTrue()) - }) + }, 3) // todo: disabled for now - // there is precondition I haven't been able to track down that breaks this test on occasion @@ -262,7 +262,7 @@ Expect(getChangeStatus("1.2.1", "1.2.2")).To(Equal(1)) Expect(getChangeStatus("2.2.1", "1.2.2")).To(Equal(-1)) Expect(getChangeStatus("2.2.1", "2.2.0")).To(Equal(-1)) - }) + }, 3) /* * XAPID-869, there should not be any panic if received duplicate snapshots during bootstrap @@ -279,6 +279,6 @@ storeBootSnapshot(snapshot) storeDataSnapshot(snapshot) restoreContext() - }) + }, 3) }) })
diff --git a/init_test.go b/init_test.go index 6135875..479b4b6 100644 --- a/init_test.go +++ b/init_test.go
@@ -14,7 +14,7 @@ initConfigDefaults() Expect(apidInfo.InstanceName).To(Equal("testhost")) - }) + }, 3) It("accept display name from config", func() { config.Set(configName, "aa01") @@ -23,7 +23,7 @@ apidInfoLatest, _ = getApidInstanceInfo() Expect(apidInfoLatest.InstanceName).To(Equal("aa01")) Expect(apidInfoLatest.LastSnapshot).To(Equal("")) - }) + }, 3) })
diff --git a/listener_test.go b/listener_test.go index e426d39..ee0b4cc 100644 --- a/listener_test.go +++ b/listener_test.go
@@ -48,7 +48,7 @@ } Expect(func() { handler.Handle(&event) }).To(Panic()) - }) + }, 3) It("should process a valid Snapshot", func() { @@ -204,7 +204,7 @@ //restore the last snapshot apidInfo.LastSnapshot = saveLastSnapshot - }) + }, 3) }) Context("ApigeeSync change event", func() { @@ -226,7 +226,7 @@ } Expect(func() { handler.Handle(&event) }).To(Panic()) - }) + }, 3) It("update event should panic", func() { @@ -243,7 +243,7 @@ Expect(func() { handler.Handle(&event) }).To(Panic()) //restore the last snapshot apidInfo.LastSnapshot = saveLastSnapshot - }) + }, 3) PIt("delete event should kill all the things!") }) @@ -329,7 +329,7 @@ Expect(len(scopes)).To(Equal(2)) Expect(scopes[0]).To(Equal("s1")) Expect(scopes[1]).To(Equal("s2")) - }) + }, 3) It("delete event should delete", func() { insert := common.ChangeList{ @@ -373,7 +373,7 @@ Expect(err).NotTo(HaveOccurred()) Expect(nRows).To(Equal(0)) - }) + }, 3) It("update event should panic", func() { @@ -390,7 +390,7 @@ Expect(func() { handler.Handle(&event) }).To(Panic()) //restore the last snapshot apidInfo.LastSnapshot = saveLastSnapshot - }) + }, 3) })
diff --git a/token_test.go b/token_test.go index 49d1eb6..045b318 100644 --- a/token_test.go +++ b/token_test.go
@@ -30,7 +30,7 @@ Expect(t.refreshIn().Seconds()).To(BeNumerically(">", 0)) Expect(t.needsRefresh()).To(BeFalse()) Expect(t.isValid()).To(BeTrue()) - }) + }, 3) It("should calculate expired token", func() { @@ -42,7 +42,7 @@ Expect(t.refreshIn().Seconds()).To(BeNumerically("<", 0)) Expect(t.needsRefresh()).To(BeTrue()) Expect(t.isValid()).To(BeFalse()) - }) + }, 3) It("should calculate token needing refresh", func() { @@ -54,7 +54,7 @@ Expect(t.refreshIn().Seconds()).To(BeNumerically("<", 0)) Expect(t.needsRefresh()).To(BeTrue()) Expect(t.isValid()).To(BeTrue()) - }) + }, 3) It("should calculate on empty token", func() { @@ -62,7 +62,7 @@ Expect(t.refreshIn().Seconds()).To(BeNumerically("<=", 0)) Expect(t.needsRefresh()).To(BeTrue()) Expect(t.isValid()).To(BeFalse()) - }) + }, 3) }) Context("tokenMan", func() { @@ -91,7 +91,7 @@ Expect(bToken).To(Equal(token.AccessToken)) testedTokenManager.close() ts.Close() - }) + }, 3) It("should refresh when forced to", func() { @@ -119,7 +119,7 @@ Expect(token.AccessToken).ToNot(Equal(token2.AccessToken)) testedTokenManager.close() ts.Close() - }) + }, 3) It("should refresh in refresh interval", func(done Done) { @@ -157,7 +157,7 @@ ts.Close() close(done) - }) + }, 3) It("should have created_at_apid first time, update_at_apid after", func(done Done) { finished := make(chan bool, 1) @@ -197,6 +197,6 @@ testedTokenManager.close() ts.Close() close(done) - }) + }, 3) }) })