Skip to content

Commit 09e87b0

Browse files
committed
Fix race in tests
1 parent 76c9e2c commit 09e87b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tailnet/coordinator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ func (c *coordinator) handleNextAgentMessage(id uuid.UUID, decoder *json.Decoder
310310
c.mutex.Unlock()
311311
return nil
312312
}
313-
c.mutex.Unlock()
314313
data, err := json.Marshal([]*Node{&node})
315314
if err != nil {
316315
return xerrors.Errorf("marshal nodes: %w", err)
@@ -328,6 +327,7 @@ func (c *coordinator) handleNextAgentMessage(id uuid.UUID, decoder *json.Decoder
328327
}()
329328
}
330329

330+
c.mutex.Unlock()
331331
wg.Wait()
332332
return nil
333333
}

0 commit comments

Comments
 (0)