TestRegulatorEnterExit fails with "expected: int(500)" "actual : uint64(0x1f4)"

go test with go 1.23.4 fails on v4.15.2-gitlab because of a return value / function argument mismatch:

export AZURE_DRIVER_VERSION=azure_v2
go test -count=1 -run TestRegulatorEnterExit ./...
ok  	github.com/docker/distribution/registry/storage/driver/azure/v2	0.008s [no tests to run]
--- FAIL: TestRegulatorEnterExit (0.00s)
    regulator_test.go:67:
        	Error Trace:	/app/registry/storage/driver/base/regulator_test.go:67
        	Error:      	Not equal:
        	            	expected: int(500)
        	            	actual  : uint64(0x1f4)
        	Test:       	TestRegulatorEnterExit
        	Messages:   	r.available
FAIL

Immediate workaround can be

diff --git a/registry/storage/driver/base/regulator_test.go b/registry/storage/driver/base/regulator_test.go
index 684a17a92..66d2fbc26 100644
--- a/registry/storage/driver/base/regulator_test.go
+++ b/registry/storage/driver/base/regulator_test.go
@@ -64,7 +64,7 @@ func TestRegulatorEnterExit(t *testing.T) {

                firstGroupDone.Wait()

-               require.Equal(t, limit, r.available, "r.available")
+               require.Equal(t, limit, int(r.available), "r.available")
        }
 }

I'm not sure why this doesn't show up in your pipeline.

https://gitlab.com/gitlab-org/container-registry/-/blob/1718b3e6715a4406aaae141cf73a77a664670872/registry/storage/driver/base/regulator.go#L22

defines available as an uint64.

Edited Feb 03, 2025 by Phileas Lebada
Assignee Loading
Time tracking Loading