(t *testing.T)
| 194 | } |
| 195 | |
| 196 | func TestQueue_ConcurrentRegisterHandler(t *testing.T) { |
| 197 | q := New[*testMessage]("test", 10) |
| 198 | defer q.Close() |
| 199 | |
| 200 | // Concurrently register handlers - should not race |
| 201 | var wg sync.WaitGroup |
| 202 | for range 10 { |
| 203 | wg.Add(1) |
| 204 | go func() { |
| 205 | defer wg.Done() |
| 206 | q.RegisterHandler(func(ctx context.Context, msg *testMessage) error { |
| 207 | return nil |
| 208 | }) |
| 209 | }() |
| 210 | } |
| 211 | wg.Wait() |
| 212 | } |
| 213 | |
| 214 | // TestQueue_SendCloseRace is a regression test for the race condition between |
| 215 | // Send and Close. Without proper synchronization, concurrent Send and Close |
nothing calls this directly
no test coverage detected