Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing unit test #404

Merged
merged 2 commits into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/operator/controllers/port_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@ var _ = Describe("Random port registration on port registry with two thousand po
defer wg.Done()
n := rand.Intn(200) + 50 // n will be between 50 and 250
time.Sleep(time.Duration(n) * time.Millisecond)
gameServerName := generateName(prefix)
var gameServerName string
for { // make sure we don't register the same GameServer twice
gameServerName = generateName(prefix)
if _, ok := gameServerNamesAndPorts.Load(gameServerName); !ok {
break
}
}
ports, err := portRegistry.GetNewPorts(testnamespace, gameServerName, 1)
Expect(err).ToNot(HaveOccurred())
Expect(len(ports)).To(Equal(1))
Expand Down