TestApp_releaseDefaultCtx_AbandonedSignalsReclaim exercises the internal releaseDefaultCtx path (called by defaultRequestHandler's defer) for an abandoned, reclaim-armed context. It mirrors what ReleaseCtx does for the public CustomCtx path and ensures both release entry points fire the latch.
(t *testing.T)
| 139 | // abandoned, reclaim-armed context. It mirrors what ReleaseCtx does for the |
| 140 | // public CustomCtx path and ensures both release entry points fire the latch. |
| 141 | func TestApp_releaseDefaultCtx_AbandonedSignalsReclaim(t *testing.T) { |
| 142 | t.Parallel() |
| 143 | app, c := acquireReclaimTestCtx(t) |
| 144 | |
| 145 | handlerDone := make(chan struct{}) |
| 146 | c.ScheduleReclaim(handlerDone, nil) |
| 147 | |
| 148 | app.releaseDefaultCtx(c) |
| 149 | require.True(t, c.IsAbandoned(), "abandoned ctx must not be pooled by releaseDefaultCtx") |
| 150 | |
| 151 | close(handlerDone) |
| 152 | require.Eventually(t, func() bool { |
| 153 | return !c.IsAbandoned() |
| 154 | }, time.Second, 5*time.Millisecond, "releaseDefaultCtx must wire signalReleased into the latch") |
| 155 | } |
| 156 | |
| 157 | // TestApp_releaseDefaultCtx_NotAbandonedPools verifies the non-abandoned branch |
| 158 | // in releaseDefaultCtx still pools the ctx through the normal path. |
nothing calls this directly
no test coverage detected