File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,24 +292,26 @@ async def test_logcontext_is_not_lost_when_awaiting_on_timeout_cancellation(
292292 incomplete_d : Deferred = Deferred ()
293293
294294 async def competing_task () -> None :
295- with LoggingContext (name = "one" , server_name = "test_server" ) as context_one :
295+ with LoggingContext (
296+ name = "competing" , server_name = "test_server"
297+ ) as context_competing :
296298 timing_out_d = timeout_deferred (
297299 deferred = incomplete_d ,
298300 timeout = 1.0 ,
299301 clock = self .clock ,
300302 )
301303 self .assertNoResult (timing_out_d )
302304 # We should still be in the logcontext we started in
303- self .assertIs (current_context (), context_one )
305+ self .assertIs (current_context (), context_competing )
304306
305307 # Mimic the normal use case to wait for the work to complete or timeout.
306308 #
307- # We expect the deferred to timeout and raise an exception at this
308- # point.
309+ # In this specific test, we expect the deferred to timeout and raise an
310+ # exception at this point.
309311 await make_deferred_yieldable (timing_out_d )
310312
311313 # We're still in the same logcontext
312- self .assertIs (current_context (), context_one )
314+ self .assertIs (current_context (), context_competing )
313315
314316 d = defer .ensureDeferred (competing_task ())
315317
You can’t perform that action at this time.
0 commit comments