MCPcopy Create free account
hub / github.com/assembla/cony / TestConsumer_Cancel_willNotBlock

Function TestConsumer_Cancel_willNotBlock

consumer_test.go:54–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestConsumer_Cancel_willNotBlock(t *testing.T) {
55 var ok bool
56 c := newTestConsumer()
57
58 go func() {
59 c.Cancel()
60 c.Cancel()
61 c.Cancel()
62 ok = true
63 }()
64
65 time.Sleep(1 * time.Microsecond) // let goroutine to work
66 if !ok {
67 t.Error("shold not block")
68 }
69}
70
71func TestConsumer_Deliveries(t *testing.T) {
72 c := newTestConsumer()

Callers

nothing calls this directly

Calls 2

newTestConsumerFunction · 0.85
CancelMethod · 0.45

Tested by

no test coverage detected