Skip to content

test(migration): wait a bit before attempting second import

Jaime Martinez requested to merge fix-max-concurrent-import-test into master

Fixes flaky TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne by allowing enough time for the import handler to release the lock on maxConcurrentImports.

I can consistently reproduce the failure by running the test in a container

go run gotest.tools/gotestsum@v1.8.2 --format testname -- ./registry/handlers -tags api_gitlab_test,integration -run "TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne" -timeout 60s -count 10
...
DONE 10 tests, 3 failures in 11.245s

Adding a small sleep before attempting the last import is enough for the test to pass.


PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.13s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.06s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.09s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.11s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.10s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.11s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.11s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.12s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.13s)
PASS registry/handlers.TestGitlabAPI_RepositoryImport_MaxConcurrentImports_OneByOne (1.11s)
PASS registry/handlers

DONE 10 tests in 12.077s
Edited by Jaime Martinez

Merge request reports