[VOL-2735]Durations in voltha-lib-go should be specified as type time.Duration not int
Change-Id: I782e44fe1dc041b9eb54fd837950d2176e18fe42
diff --git a/pkg/db/backend_test.go b/pkg/db/backend_test.go
index 865d239..f96ed19 100644
--- a/pkg/db/backend_test.go
+++ b/pkg/db/backend_test.go
@@ -31,7 +31,7 @@
const (
embedEtcdServerHost = "localhost"
- defaultTimeout = 1
+ defaultTimeout = 1 * time.Second
defaultPathPrefix = "Prefix"
)
@@ -119,7 +119,7 @@
// Liveness Check against Embedded Etcd Server should return alive state
func TestPerformLivenessCheck_EmbeddedEtcdServer(t *testing.T) {
backend := provisionBackendWithEmbeddedEtcdServer(t)
- ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
defer cancel()
alive := backend.PerformLivenessCheck(ctx)
assert.True(t, alive)
@@ -128,7 +128,7 @@
// Liveness Check against Dummy Etcd Server should return not-alive state
func TestPerformLivenessCheck_DummyEtcdServer(t *testing.T) {
backend := provisionBackendWithDummyEtcdServer(t)
- ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
defer cancel()
alive := backend.PerformLivenessCheck(ctx)
assert.False(t, alive)
@@ -148,7 +148,7 @@
// Enabling Liveness Channel after First Liveness Check
func TestEnableLivenessChannel_EmbeddedEtcdServer_AfterLivenessCheck(t *testing.T) {
backend := provisionBackendWithEmbeddedEtcdServer(t)
- ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
defer cancel()
backend.PerformLivenessCheck(ctx)