Distribution: the incoming-full finding is said off the publish's path
Builds: design 47 G (publish path of oci-artifact-registry; no design line covers it)
This commit is contained in:
@@ -18,3 +18,17 @@ func TestAHungStepAnswersWithItsName(t *testing.T) {
|
||||
t.Fatalf("%d %v", v, err)
|
||||
}
|
||||
}
|
||||
|
||||
// The finding is said off the caller's path: a writer that never answers does not hold the call that says it.
|
||||
func TestAFindingIsSaidOffThePath(t *testing.T) {
|
||||
block := make(chan struct{})
|
||||
defer close(block)
|
||||
say := boundedFinding(func(string, string, string, bool) { <-block })
|
||||
done := make(chan struct{})
|
||||
go func() { say("incoming-full", "incoming", "w", false); say("incoming-full", "incoming", "w", false); close(done) }()
|
||||
select {
|
||||
case <-done:
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Fatal("the call was held by the finding")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user