From a168234aeab20ea93cabd29141b095d041453a6b Mon Sep 17 00:00:00 2001 From: Alex Bogomolov Date: Thu, 18 Jan 2018 22:05:10 +0200 Subject: [PATCH] fix mysql test --- .travis.yml | 2 +- database/mysql/mysql_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9535b365..88dad43c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ services: install: - make deps - (cd $GOPATH/src/github.com/docker/docker && git fetch --all --tags --prune && git checkout v17.05.0-ce) - - sudo apt-get update && sudo apt-get install docker-ce=17.05.0* + - sudo apt-get update && sudo apt-get --allow-downgrades install docker-ce=17.05.0* - go get github.com/mattn/goveralls script: diff --git a/database/mysql/mysql_test.go b/database/mysql/mysql_test.go index f2b12e8e..61c0f305 100644 --- a/database/mysql/mysql_test.go +++ b/database/mysql/mysql_test.go @@ -11,6 +11,7 @@ import ( // "github.com/go-sql-driver/mysql" dt "github.com/mattes/migrate/database/testing" mt "github.com/mattes/migrate/testing" + "time" ) var versions = []mt.Version{ @@ -42,6 +43,7 @@ func Test(t *testing.T) { func(t *testing.T, i mt.Instance) { p := &Mysql{} addr := fmt.Sprintf("mysql://root:root@tcp(%v:%v)/public", i.Host(), i.Port()) + time.Sleep(time.Second * 15) // it seems that sometimes MySQL server is not started yet and the test fails d, err := p.Open(addr) if err != nil { t.Fatalf("%v", err)