Skip to content

Commit

Permalink
Fix potential race
Browse files Browse the repository at this point in the history
  • Loading branch information
zbud-msft committed Dec 19, 2024
1 parent 1b4313e commit a3a12e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gnmi_server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,20 @@ func TestPFCWDErrors(t *testing.T) {
}
}

mutexGotNoti.Lock()

if len(gotNoti) == 0 {
t.Errorf("Expected non zero length of notifications")
}

mutexGotNoti.Lock()
if diff := pretty.Compare(tt.wantNoti, gotNoti); diff != "" {
t.Log("\n Want: \n", tt.wantNoti)
t.Log("\n Got : \n", gotNoti)
t.Errorf("unexpected updates:\n%s", diff)
}

mutexGotNoti.Unlock()

c.Close()
})
}
Expand Down

0 comments on commit a3a12e6

Please sign in to comment.