Skip to content

Commit

Permalink
Fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
zbud-msft committed Jul 27, 2023
1 parent 930e3dd commit 01cadd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnmi_server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3324,19 +3324,19 @@ func TestTableKeyOnDeletion(t *testing.T) {
time.Sleep(time.Millisecond * 1500)

mutexNoti.Lock()
defer mutexNoti.Unlock()
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)
}
mutexNoti.Unlock()

mutexPaths.Lock()
defer mutexPaths.Unlock()
for _, path := range tt.paths {
rclient.HSet(path, "state", "Established")
rclient.HSet(path, "peerType", "e-BGP")
}
mutexPaths.Unlock()
})
}
}
Expand Down

0 comments on commit 01cadd0

Please sign in to comment.