@@ -375,7 +375,7 @@ def test_request_cancellation_trtllm_kv_transfer_cancel(
375375 End-to-end test for request cancellation during prefill to decode KV transfer phase.
376376
377377 This test verifies that when a request is cancelled by the client during the KV transfer phase,
378- the system properly handles the cancellation and cleans up resources on the prefill worker .
378+ the system properly handles the cancellation and cleans up resources on the workers .
379379 """
380380
381381 # Step 1: Start the frontend
@@ -410,25 +410,24 @@ def test_request_cancellation_trtllm_kv_transfer_cancel(
410410 match_type = "contains" ,
411411 )
412412
413- # Poll for start sending KV cache pattern
414- _ , prefill_log_offset = poll_for_pattern (
415- process = prefill_worker ,
416- pattern = "Start sending KV cache for request ID: " ,
417- log_offset = prefill_log_offset ,
413+ # Poll for decode worker entry signaling start of KV transfer phase
414+ _ , decode_log_offset = poll_for_pattern (
415+ process = decode_worker ,
416+ pattern = f"Decode Request ID: { request_id } " ,
418417 poll_interval_ms = 2 ,
419- match_type = "contains" ,
420418 )
421419
422- # Cancel during KV transfer phase
420+ # Cancel during KV transfer phase in decode worker
423421 cancellable_req .cancel ()
424422 logger .info (
425- f"Cancelled request ID: { request_id } during KV transfer phase "
423+ f"Cancelled request ID: { request_id } at beginning of decode "
426424 )
427425
428426 # Poll for "Aborted Request ID" in decode worker
429427 _ , decode_log_offset = poll_for_pattern (
430428 process = decode_worker ,
431429 pattern = f"Aborted Request ID: { request_id } " ,
430+ log_offset = decode_log_offset ,
432431 )
433432
434433 # Verify frontend log has kill message
@@ -438,7 +437,7 @@ def test_request_cancellation_trtllm_kv_transfer_cancel(
438437 )
439438
440439 logger .info (
441- "Completion request cancellation during KV transfer phase detected successfully"
440+ "Completion request cancellation at beginning of decode detected successfully"
442441 )
443442
444443 # Verify the workers are still functional
0 commit comments