@@ -588,21 +588,28 @@ async def test_opentelemetry_safe_detach(client: Client):
588588
589589 with LogCapturer ().logs_captured (opentelemetry .context .logger ) as capturer :
590590 try :
591+ print ("===== in detach test" )
591592 handle = await client .start_workflow (
592593 CacheEvictionTearDownWorkflow .run ,
593594 id = f"wf-{ uuid .uuid4 ()} " ,
594595 task_queue = worker .task_queue ,
595596 )
596597
597598 # CacheEvictionTearDownWorkflow requires 3 signals to be sent
599+ print ("===== signal 1" )
598600 await handle .signal (CacheEvictionTearDownWorkflow .signal )
601+ print ("===== signal 2" )
599602 await handle .signal (CacheEvictionTearDownWorkflow .signal )
603+ print ("===== signal 3" )
600604 await handle .signal (CacheEvictionTearDownWorkflow .signal )
601605
606+ print ("===== awaiting result" )
602607 await handle .result ()
603608 finally :
604609 sys .unraisablehook = old_hook
605610
611+ print ("===== inspecting logs" )
612+
606613 # Confirm at least 1 exception
607614 if len (hook_calls ) < 1 :
608615 logging .warning (
@@ -615,6 +622,6 @@ def otel_context_error(record: logging.LogRecord) -> bool:
615622 and "Failed to detach context" in record .message
616623 )
617624
618- assert (
619- capturer . find ( otel_context_error ) is None
620- ), "Detach from context message should not be logged"
625+ assert capturer . find ( otel_context_error ) is None , (
626+ "Detach from context message should not be logged"
627+ )
0 commit comments