Skip to content

Commit

Permalink
locksmith: set max semaphore to 3
Browse files Browse the repository at this point in the history
With recent upgrade from Go 1.21 to Go 1.22 we noticed that this test has
never run as designed.

Previously this test was rebooting only one machine while it's supposed
to coordinate the reboot of 3 machines.

It was an issue with the "for" loop:

> Previously, the variables declared by a “for” loop were created
> once and updated by each iteration. In Go 1.22, each iteration
> of the loop creates new variables, to avoid accidental sharing bugs.

Now we set the maximum of token to 3, this is not recommended in
production as it might create a downtime but here it's ok for testing
purposes.

Race condition should not occur as there is a 5 minutes delay between
the command and the actual reboot.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 committed Jul 29, 2024
1 parent a915ad1 commit 8299ca8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kola/tests/locksmith/locksmith.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func locksmithCluster(c cluster.TestCluster) {
}

c.MustSSH(machs[0], "locksmithctl status")
c.MustSSH(machs[0], "locksmithctl set-max 3")

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
Expand Down

0 comments on commit 8299ca8

Please sign in to comment.