Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/app/profile_model_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,14 @@ func TestModelCheckRunsWithTheWriteLockReleased(t *testing.T) {
core := gatewayCore(t, gateway)
var heldDuringProbe atomic.Bool
var probed atomic.Bool
// The protocols are probed concurrently, and the TryLock below takes the
// lock for an instant. Without this, one probe's own attempt is what another
// probe finds held.
var oneProbeAtATime sync.Mutex
gateway.mu.Lock()
gateway.onRequest = func() {
oneProbeAtATime.Lock()
defer oneProbeAtATime.Unlock()
probed.Store(true)
if !core.writeMu.TryLock() {
heldDuringProbe.Store(true)
Expand Down
Loading