If this verification succeeds, there will be leaked goroutine left behind. It will be cleaned once grpc server is shut down.
(t *testing.T, querierLoop schedulerpb.SchedulerForQuerier_QuerierLoopClient, timeout time.Duration)
| 651 | |
| 652 | // If this verification succeeds, there will be leaked goroutine left behind. It will be cleaned once grpc server is shut down. |
| 653 | func verifyQuerierDoesntReceiveRequest(t *testing.T, querierLoop schedulerpb.SchedulerForQuerier_QuerierLoopClient, timeout time.Duration) { |
| 654 | ch := make(chan any, 1) |
| 655 | |
| 656 | go func() { |
| 657 | m, e := querierLoop.Recv() |
| 658 | if e != nil { |
| 659 | ch <- e |
| 660 | } else { |
| 661 | ch <- m |
| 662 | } |
| 663 | }() |
| 664 | |
| 665 | select { |
| 666 | case val := <-ch: |
| 667 | require.Failf(t, "expected timeout", "got %v", val) |
| 668 | case <-time.After(timeout): |
| 669 | return |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | func verifyNoPendingRequestsLeft(t *testing.T, scheduler *Scheduler) { |
| 674 | test.Poll(t, 1*time.Second, 0, func() any { |
no test coverage detected