MCPcopy
hub / github.com/docker/compose / TestDoneDeadlockFix

Function TestDoneDeadlockFix

cmd/display/tty_test.go:552–570  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

550}
551
552func TestDoneDeadlockFix(t *testing.T) {
553 w, _ := newTestWriter()
554 addTask(w, "test-task", "Working", "details", api.Working)
555 ctx, cancel := context.WithCancel(t.Context())
556 defer cancel()
557
558 w.Start(ctx, "test")
559 done := make(chan bool)
560 go func() {
561 w.Done("test", true)
562 done <- true
563 }()
564
565 select {
566 case <-done:
567 case <-time.After(5 * time.Second):
568 t.Fatal("Deadlock detected: Done() did not complete within 5 seconds")
569 }
570}
571
572// TestAdjustLineWidth_WideProgressForcesSizeInfoDrop is the unit-level
573// regression test for docker/compose#13595. When progress contains the

Callers

nothing calls this directly

Calls 4

newTestWriterFunction · 0.85
addTaskFunction · 0.85
StartMethod · 0.65
DoneMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…