TestDefaultCtx_ScheduleReclaim_NilCancel exercises the cancel==nil branch.
(t *testing.T)
| 87 | |
| 88 | // TestDefaultCtx_ScheduleReclaim_NilCancel exercises the cancel==nil branch. |
| 89 | func TestDefaultCtx_ScheduleReclaim_NilCancel(t *testing.T) { |
| 90 | t.Parallel() |
| 91 | app, c := acquireReclaimTestCtx(t) |
| 92 | |
| 93 | handlerDone := make(chan struct{}) |
| 94 | c.ScheduleReclaim(handlerDone, nil) |
| 95 | |
| 96 | close(handlerDone) |
| 97 | app.ReleaseCtx(c) |
| 98 | |
| 99 | require.Eventually(t, func() bool { |
| 100 | return !c.IsAbandoned() |
| 101 | }, time.Second, 5*time.Millisecond, "nil cancel must not block reclamation") |
| 102 | } |
| 103 | |
| 104 | // TestDefaultCtx_signalReleased_NoReclaim guards that calling signalReleased on |
| 105 | // a context that was never armed for reclamation is a safe no-op. This is the |
nothing calls this directly
no test coverage detected