Verifies that signals are written to the destination channel in the order they are received, in a typical concurrent reader/writer scenario.
(t *testing.T)
| 24 | // Verifies that signals are written to the destination channel in the |
| 25 | // order they are received, in a typical concurrent reader/writer scenario. |
| 26 | func TestSequentialHandlerSequential(t *testing.T) { |
| 27 | t.Parallel() |
| 28 | |
| 29 | handler := NewSequentialSignalHandler() |
| 30 | |
| 31 | channel := make(chan *Signal, 10) |
| 32 | handler.(SignalRegistrar).AddSignal(channel) |
| 33 | |
| 34 | done := make(chan struct{}) |
| 35 | |
| 36 | // Concurrently read and write signals |
| 37 | go func() { |
| 38 | readSignals(t, channel) |
| 39 | close(done) |
| 40 | }() |
| 41 | writeSignals(handler, 1000) |
| 42 | <-done |
| 43 | } |
| 44 | |
| 45 | // Test that in the case of multiple destination channels, one channel |
| 46 | // being blocked does not prevent the other channel receiving messages. |
nothing calls this directly
no test coverage detected
searching dependent graphs…