Release 3X-UI for Docker / build (push) Canceled after 0s
Release 3X-UI / build (386) (push) Canceled after 0s
Release 3X-UI / build (amd64) (push) Canceled after 0s
Release 3X-UI / build (arm64) (push) Canceled after 0s
Release 3X-UI / build (armv5) (push) Canceled after 0s
Release 3X-UI / build (armv6) (push) Canceled after 0s
Release 3X-UI / build (armv7) (push) Canceled after 0s
Release 3X-UI / build (s390x) (push) Canceled after 0s
Release 3X-UI / Build for Windows (amd64) (push) Canceled after 0s
Release 3X-UI / Publish rolling dev release (push) Canceled after 0s
27 lines
497 B
Go
27 lines
497 B
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestLockInboundReleasesRegistryMutexWhileWaiting(t *testing.T) {
|
|
const id = 990006
|
|
held := lockInbound(id)
|
|
|
|
parked := make(chan struct{})
|
|
go func() {
|
|
close(parked)
|
|
lockInbound(id).Unlock()
|
|
}()
|
|
<-parked
|
|
time.Sleep(50 * time.Millisecond)
|
|
|
|
if !inboundMutationLocksMu.TryLock() {
|
|
held.Unlock()
|
|
t.Fatal("registry mutex is held while a lockInbound caller waits on a busy inbound")
|
|
}
|
|
inboundMutationLocksMu.Unlock()
|
|
held.Unlock()
|
|
}
|