Skip to content

Commit

Permalink
[BPF] fix race in bpf_ep_mgr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastigera committed Aug 30, 2024
1 parent 51e5a7e commit 4a7446e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions felix/dataplane/linux/bpf_ep_mgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (m *mockDataplane) loadDefaultPolicies() error {
}

func (m *mockDataplane) ensureProgramAttached(ap attachPoint) (qDiscInfo, error) {
m.mutex.Lock()
defer m.mutex.Unlock()

var qdisc qDiscInfo
key := ap.IfaceName() + ":" + ap.HookName().String()
m.numAttaches[key] = m.numAttaches[key] + 1
Expand Down

0 comments on commit 4a7446e

Please # to comment.