@@ -78,7 +78,7 @@ func TestAppHealth_Healthy(t *testing.T) {
78
78
healthchecksStarted := make ([]string , 2 )
79
79
for i := 0 ; i < 2 ; i ++ {
80
80
c := healthcheckTrap .MustWait (ctx )
81
- c .Release ( )
81
+ c .MustRelease ( ctx )
82
82
healthchecksStarted [i ] = c .Tags [1 ]
83
83
}
84
84
slices .Sort (healthchecksStarted )
@@ -87,7 +87,7 @@ func TestAppHealth_Healthy(t *testing.T) {
87
87
// advance the clock 1ms before the report ticker starts, so that it's not
88
88
// simultaneous with the checks.
89
89
mClock .Advance (time .Millisecond ).MustWait (ctx )
90
- reportTrap .MustWait (ctx ).Release ( )
90
+ reportTrap .MustWait (ctx ).MustRelease ( ctx )
91
91
92
92
mClock .Advance (999 * time .Millisecond ).MustWait (ctx ) // app2 is now healthy
93
93
@@ -143,11 +143,11 @@ func TestAppHealth_500(t *testing.T) {
143
143
144
144
fakeAPI , closeFn := setupAppReporter (ctx , t , slices .Clone (apps ), handlers , mClock )
145
145
defer closeFn ()
146
- healthcheckTrap .MustWait (ctx ).Release ( )
146
+ healthcheckTrap .MustWait (ctx ).MustRelease ( ctx )
147
147
// advance the clock 1ms before the report ticker starts, so that it's not
148
148
// simultaneous with the checks.
149
149
mClock .Advance (time .Millisecond ).MustWait (ctx )
150
- reportTrap .MustWait (ctx ).Release ( )
150
+ reportTrap .MustWait (ctx ).MustRelease ( ctx )
151
151
152
152
mClock .Advance (999 * time .Millisecond ).MustWait (ctx ) // check gets triggered
153
153
mClock .Advance (time .Millisecond ).MustWait (ctx ) // report gets triggered, but unsent since we are at the threshold
@@ -202,25 +202,25 @@ func TestAppHealth_Timeout(t *testing.T) {
202
202
203
203
fakeAPI , closeFn := setupAppReporter (ctx , t , apps , handlers , mClock )
204
204
defer closeFn ()
205
- healthcheckTrap .MustWait (ctx ).Release ( )
205
+ healthcheckTrap .MustWait (ctx ).MustRelease ( ctx )
206
206
// advance the clock 1ms before the report ticker starts, so that it's not
207
207
// simultaneous with the checks.
208
208
mClock .Set (ms (1 )).MustWait (ctx )
209
- reportTrap .MustWait (ctx ).Release ( )
209
+ reportTrap .MustWait (ctx ).MustRelease ( ctx )
210
210
211
211
w := mClock .Set (ms (1000 )) // 1st check starts
212
- timeoutTrap .MustWait (ctx ).Release ( )
212
+ timeoutTrap .MustWait (ctx ).MustRelease ( ctx )
213
213
mClock .Set (ms (1001 )).MustWait (ctx ) // report tick, no change
214
214
mClock .Set (ms (1999 )) // timeout pops
215
215
w .MustWait (ctx ) // 1st check finished
216
216
w = mClock .Set (ms (2000 )) // 2nd check starts
217
- timeoutTrap .MustWait (ctx ).Release ( )
217
+ timeoutTrap .MustWait (ctx ).MustRelease ( ctx )
218
218
mClock .Set (ms (2001 )).MustWait (ctx ) // report tick, no change
219
219
mClock .Set (ms (2999 )) // timeout pops
220
220
w .MustWait (ctx ) // 2nd check finished
221
221
// app is now unhealthy after 2 timeouts
222
222
mClock .Set (ms (3000 )) // 3rd check starts
223
- timeoutTrap .MustWait (ctx ).Release ( )
223
+ timeoutTrap .MustWait (ctx ).MustRelease ( ctx )
224
224
mClock .Set (ms (3001 )).MustWait (ctx ) // report tick, sends changes
225
225
226
226
update := testutil .TryReceive (ctx , t , fakeAPI .AppHealthCh ())
0 commit comments