Agola build/test: the run failed because of TestCreateProject

Updating PR #90 on github triggered the build/test on agola and the “integration tests” task failed with this error (the other ones passed):

Shell: /bin/sh -e
Exit Status: 1
Command: AGOLA_BIN_DIR="./bin" GITEA_PATH=${PWD}/bin/gitea DOCKER_BRIDGE_ADDRESS="172.18.0.1" ./bin/integration-tests -test.parallel 1 -test.v
Log:
=== RUN TestCreateLinkedAccount
--- FAIL: TestCreateLinkedAccount (5.24s)
utils.go:79: [gitea 7a6c5a79]: 2019/09/18 06:33:45 [T] AppPath: /root/project/bin/gitea
utils.go:79: [gitea 7a6c5a79]: 2019/09/18 06:33:45 [T] AppWorkPath: /root/project/bin
utils.go:79: [gitea 7a6c5a79]: 2019/09/18 06:33:45 [T] Custom path: /root/project/bin/custom
utils.go:79: [gitea 7a6c5a79]: 2019/09/18 06:33:45 [T] Log path: /tmp/agola565979019/gitea/gitea/log
setup_test.go:100: unexpected err: exit status 1, out: 2019/09/18 06:33:50 [I] XORM Log Mode: File(Info)
CreateUser: database is locked
=== RUN TestCreateProject
--- FAIL: TestCreateProject (6.18s)
utils.go:79: [gitea 268bd9f1]: 2019/09/18 06:33:50 [T] AppPath: /root/project/bin/gitea
utils.go:79: [gitea 268bd9f1]: 2019/09/18 06:33:50 [T] AppWorkPath: /root/project/bin
utils.go:79: [gitea 268bd9f1]: 2019/09/18 06:33:50 [T] Custom path: /root/project/bin/custom
utils.go:79: [gitea 268bd9f1]: 2019/09/18 06:33:50 [T] Log path: /tmp/agola257564014/gitea/gitea/log
setup_test.go:100: unexpected err: exit status 1, out: 2019/09/18 06:33:55 [I] XORM Log Mode: File(Info)
CreateUser: database is locked

Full log: https://run.agola.io/org/agola/projects/agola.proj/runs/0000001ei649k-000000000009m/tasks/663e5261-7a55-4ef6-a137-0911223d2673

Before to push on github repo all tests passed on my local environment. What am I missing?

Thanks

Sometimes tests are flaky since we aren’t waiting for services to be ready before doing operations (sometimes we have just a time.Sleep). We should find a way to wait for the services to be completely ready before doing operations on them.