Skip to content

Commit

Permalink
Add timeout before test to wait for docker postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
bogh committed Apr 11, 2017
1 parent 3d981e1 commit c0c1b25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/kvstore/postgres_test.go
Expand Up @@ -2,6 +2,7 @@ package kvstore

import (
"testing"
"time"

"github.com/cosminrentea/gobbler/testutil"

Expand Down Expand Up @@ -37,6 +38,8 @@ func TestPostgresKVStore_IterateKeys(t *testing.T) {

func TestPostgresKVStore_Check(t *testing.T) {
testutil.SkipIfShort(t)
// make sure to postgres container initialization is done
time.Sleep(5 * time.Second)
a := assert.New(t)

kvs := NewPostgresKVStore(aPostgresConfig())
Expand All @@ -62,7 +65,7 @@ func TestPostgresKVStore_Open(t *testing.T) {
func aPostgresConfig() PostgresConfig {
return PostgresConfig{
ConnParams: map[string]string{
"host": "0.0.0.0",
"host": "localhost",
"user": "postgres",
"password": "",
"dbname": "guble",
Expand Down

0 comments on commit c0c1b25

Please sign in to comment.