minder
minder copied to clipboard
tests using createRandomOrganization occasionally create invalid org names
Describe the issue
Tests using createRandomOrganization occasionally run into a key violation due to this line creating identical names when lower-cased.
❌ TestCreateProfileStatusMultiRuleTransitions/0x87 (30ms)
profiles_test.go:2802:
Error Trace: /Users/michelangelo/stacklok/minder/internal/db/organizations_test.go:42
/Users/michelangelo/stacklok/minder/internal/db/profiles_test.go:179
/Users/michelangelo/stacklok/minder/internal/db/profiles_test.go:2802
Error: Received unexpected error:
pq: duplicate key value violates unique constraint "project_name_lower_idx"
Test: TestCreateProfileStatusMultiRuleTransitions/0x87
This is a minor issue.
To Reproduce
Running this repeatedly should trigger the error. Note that the test is currently in a PR under review.
$ go test -json -race -v ./internal/db/... -run "TestCreateProfileStatusMultiRuleTransitions" | gotestfmt
What version are you using?
main
@blkt is this still a problem?
Yes, but very unlikely to happen. I believe we can close it.
I got this error another time today, so it happened twice in a quarter. :D
❌ TestCreateProfileStatusMultiRuleTransitions/0x16 (20ms)
profiles_test.go:3010:
Error Trace: /Users/michelangelo/stacklok/minder/internal/db/organizations_test.go:42
/Users/michelangelo/stacklok/minder/internal/db/profiles_test.go:255
/Users/michelangelo/stacklok/minder/internal/db/profiles_test.go:3010
Error: Received unexpected error:
pq: duplicate key value violates unique constraint "project_name_lower_idx"
Test: TestCreateProfileStatusMultiRuleTransitions/0x16
Looks like this is probably still a low-occurrence bug.