We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f7dc04 commit bf6a1e1Copy full SHA for bf6a1e1
1 file changed
cli-plugins/socket/socket_test.go
@@ -54,9 +54,9 @@ func TestPluginServer(t *testing.T) {
54
})
55
56
t.Run("allows reconnects", func(t *testing.T) {
57
- var calls int32
+ var calls atomic.Int32
58
h := func(_ net.Conn) {
59
- atomic.AddInt32(&calls, 1)
+ calls.Add(1)
60
}
61
62
srv, err := NewPluginServer(h)
@@ -70,7 +70,7 @@ func TestPluginServer(t *testing.T) {
70
71
waitForCalls := func(n int) {
72
poll.WaitOn(t, func(t poll.LogT) poll.Result {
73
- if atomic.LoadInt32(&calls) == int32(n) {
+ if calls.Load() == int32(n) {
74
return poll.Success()
75
76
return poll.Continue("waiting for handler to be called")
0 commit comments