Skip to content

test(handlers): remove colon from test assertion

Jaime Martinez requested to merge test-fix-flaky-timeout into master

There are some flaky tests when we try to assert a (pre)import that timed out. The assertion used to contain a "timeout:" with a colon at the end, however, there are a few places where the timeout could be identified so the message is not always the same. For example:

    api_gitlab_integration_test.go:229: 
266        	Error Trace:	/builds/gitlab-org/container-registry/registry/handlers/integration_helpers_test.go:1658
267        	            				/builds/gitlab-org/container-registry/registry/handlers/api_gitlab_integration_test.go:229
268        	Error:      	"creating or finding repository in database: finding or creating namespace: scanning namespace: failed to connect to `host=db user=postgres database=registry_test`: hostname resolving error (lookup db on 127.0.0.11:53: dial udp 127.0.0.11:53: i/o timeout)" does not contain "timeout:"
269        	Test:       	TestGitlabAPI_RepositoryPreImport_Put_PreImportTimeout
270        	Messages:   	detail mismatch

Removing the colon at the end of the assertion should help remove the flaky failures we get from these tests.

Merge request reports