Skip to content

GTEST/UCP: Check wait condition after every progress call - #12242

Merged
tvegas1 merged 2 commits into
openucx:masterfrom
dmitrygx:topic/ucx/gtest-ucp-wait-progress
Nov 16, 2026
Merged

tvegas1 merged 2 commits into
openucx:masterfrom
dmitrygx:topic/ucx/gtest-ucp-wait-progress

Conversation

@dmitrygx

@dmitrygx dmitrygx commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

What?

ucp_test::wait_for_flag() and ucp_test::wait_for_value() check their
condition after every progress() call instead of after every
short_progress_loop().

Why?

short_progress_loop() runs progress() 100 times with usleep(100) after
each call, which takes about 16 ms. The wait helpers checked the condition only
between such loops, so every wait that was not satisfied on entry took at least
16 ms, even when the condition became true a few microseconds later. Tests that
wait in a loop pay this on every iteration. For example, in the RMA variants of
the wireup stress tests the receiver waits for the last put 1000-2000 times per
test.

The same tests with and without this change, time per test (10-CPU container,
ConnectX-7):

Test Variants master this PR
udx/test_ucp_wireup_1sided.stress_connect2 rma (/0-/3) 16.1-16.3 s 0.6-0.8 s
tag (/4-/9) 0.6-0.8 s 0.6-0.8 s
tcp/test_ucp_wireup_1sided.stress_connect2 rma (/0-/3) 16.2-16.3 s 0.6-0.7 s
udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect rma (/0-/3) 31.8-32.0 s 0.7-0.9 s
udx/test_ucp_wireup_2sided.multi_ep_2sided rma (/0-/3) 1.9 s 0.6-0.7 s
rcx/test_ucp_am_nbx_dts.short_bcopy_send all 1.9-2.2 s 0.7-0.9 s
tcp/test_ucp_am_nbx_dts.short_bcopy_send all 1.6-1.8 s 0.3-0.5 s

Based on the Azure PR pipeline timings, this saves about 96 agent-minutes per
build, 25 of them on the GPU pool.

gtest output, master (db31790) and this PR
### base (master db31790ce)
Note: Google Test filter = udx/test_ucp_wireup_1sided.stress_connect2/*
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/0 (16194 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/1 (16087 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/2 (16290 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/3 (16202 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/4 (599 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/5 (776 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/6 (724 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/7 (653 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/8 (753 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/9 (722 ms)
[==========] 10 tests from 1 test suite ran. (69001 ms total)

### patched (this PR)
Note: Google Test filter = udx/test_ucp_wireup_1sided.stress_connect2/*
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/0 (838 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/1 (616 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/2 (705 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/3 (808 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/4 (819 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/5 (640 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/6 (610 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/7 (618 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/8 (655 ms)
[ RUN      ] udx/test_ucp_wireup_1sided.stress_connect2/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_1sided.stress_connect2/9 (623 ms)
[==========] 10 tests from 1 test suite ran. (6934 ms total)

### base (master db31790ce)
Note: Google Test filter = udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/*
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/0 (31834 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/1 (31809 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/2 (32001 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/3 (31918 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/4 (653 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/5 (703 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/6 (730 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/7 (854 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/8 (638 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/9 (685 ms)
[==========] 10 tests from 1 test suite ran. (131827 ms total)

### patched (this PR)
Note: Google Test filter = udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/*
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/0 (692 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/1 (742 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/2 (838 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/3 (879 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/4 (629 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/5 (692 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/6 (674 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/7 (813 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/8 (645 ms)
[ RUN      ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_errh_peer.stress_connect_force_disconnect/9 (680 ms)
[==========] 10 tests from 1 test suite ran. (7286 ms total)

### base (master db31790ce)
Note: Google Test filter = udx/test_ucp_wireup_2sided.multi_ep_2sided/*
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/0 (1914 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/1 (1919 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/2 (1875 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/3 (1868 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/4 (604 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/5 (661 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/6 (611 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/7 (639 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/8 (799 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/9 (647 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/10 <ud_x/stream>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/10 (549 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/11 <ud_x/stream,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/11 (663 ms)
[==========] 12 tests from 1 test suite ran. (12753 ms total)

### patched (this PR)
Note: Google Test filter = udx/test_ucp_wireup_2sided.multi_ep_2sided/*
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/0 <ud_x/rma>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/0 (688 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/1 <ud_x/rma,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/1 (602 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/2 <ud_x/rma,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/2 (626 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/3 <ud_x/rma,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/3 (609 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/4 <ud_x/tag>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/4 (603 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/5 <ud_x/tag,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/5 (592 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/6 <ud_x/tag,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/6 (638 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/7 <ud_x/tag,unified,no_ep_match>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/7 (548 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/8 <ud_x/tag,addr_v2>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/8 (674 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/9 <ud_x/tag,unified,addr_v2>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/9 (536 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/10 <ud_x/stream>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/10 (636 ms)
[ RUN      ] udx/test_ucp_wireup_2sided.multi_ep_2sided/11 <ud_x/stream,unified>
[       OK ] udx/test_ucp_wireup_2sided.multi_ep_2sided/11 (563 ms)
[==========] 12 tests from 1 test suite ran. (7316 ms total)

### base (master db31790ce)
Note: Google Test filter = tcp/test_ucp_wireup_1sided.stress_connect2/*
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/0 <tcp/rma>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/0 (16230 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/1 <tcp/rma,unified>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/1 (16216 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/2 <tcp/rma,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/2 (16197 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/3 <tcp/rma,unified,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/3 (16289 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/4 <tcp/tag>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/4 (640 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/5 <tcp/tag,unified>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/5 (662 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/6 <tcp/tag,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/6 (651 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/7 <tcp/tag,unified,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/7 (659 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/8 <tcp/tag,addr_v2>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/8 (759 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/9 <tcp/tag,unified,addr_v2>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/9 (619 ms)
[==========] 10 tests from 1 test suite ran. (68924 ms total)

### patched (this PR)
Note: Google Test filter = tcp/test_ucp_wireup_1sided.stress_connect2/*
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/0 <tcp/rma>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/0 (707 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/1 <tcp/rma,unified>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/1 (704 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/2 <tcp/rma,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/2 (678 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/3 <tcp/rma,unified,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/3 (633 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/4 <tcp/tag>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/4 (648 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/5 <tcp/tag,unified>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/5 (630 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/6 <tcp/tag,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/6 (646 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/7 <tcp/tag,unified,no_ep_match>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/7 (601 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/8 <tcp/tag,addr_v2>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/8 (730 ms)
[ RUN      ] tcp/test_ucp_wireup_1sided.stress_connect2/9 <tcp/tag,unified,addr_v2>
[       OK ] tcp/test_ucp_wireup_1sided.stress_connect2/9 (701 ms)
[==========] 10 tests from 1 test suite ran. (6679 ms total)

### base (master db31790ce)
Note: Google Test filter = rcx/test_ucp_am_nbx_dts.*
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/0 <rc_x>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/0 (2086 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/1 <rc_x/proto_v1>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/1 (1873 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/2 <rc_x/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/2 (2106 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/3 <rc_x/proto_v1/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/3 (1962 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/4 <rc_x/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/4 (2180 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/5 <rc_x/proto_v1/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/5 (1915 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/6 <rc_x/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/6 (2097 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/7 <rc_x/proto_v1/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/7 (2090 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/0 <rc_x>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/0 (1689 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/1 <rc_x/proto_v1>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/1 (1532 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/2 <rc_x/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/2 (1744 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/3 <rc_x/proto_v1/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/3 (1537 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/4 <rc_x/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/4 (1719 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/5 <rc_x/proto_v1/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/5 (1534 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/6 <rc_x/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/6 (1747 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/7 <rc_x/proto_v1/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/7 (1507 ms)
[==========] 16 tests from 1 test suite ran. (29318 ms total)

### patched (this PR)
Note: Google Test filter = rcx/test_ucp_am_nbx_dts.*
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/0 <rc_x>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/0 (882 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/1 <rc_x/proto_v1>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/1 (681 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/2 <rc_x/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/2 (852 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/3 <rc_x/proto_v1/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/3 (653 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/4 <rc_x/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/4 (897 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/5 <rc_x/proto_v1/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/5 (690 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/6 <rc_x/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/6 (893 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/7 <rc_x/proto_v1/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.short_bcopy_send/7 (667 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/0 <rc_x>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/0 (884 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/1 <rc_x/proto_v1>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/1 (674 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/2 <rc_x/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/2 (842 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/3 <rc_x/proto_v1/reply>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/3 (891 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/4 <rc_x/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/4 (753 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/5 <rc_x/proto_v1/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/5 (596 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/6 <rc_x/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/6 (946 ms)
[ RUN      ] rcx/test_ucp_am_nbx_dts.zcopy_send/7 <rc_x/proto_v1/reply/errh>
[       OK ] rcx/test_ucp_am_nbx_dts.zcopy_send/7 (680 ms)
[==========] 16 tests from 1 test suite ran. (12482 ms total)

### base (master db31790ce)
Note: Google Test filter = tcp/test_ucp_am_nbx_dts.*
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/0 <tcp>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/0 (1697 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/1 <tcp/proto_v1>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/1 (1654 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/2 <tcp/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/2 (1668 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/3 <tcp/proto_v1/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/3 (1646 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/4 <tcp/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/4 (1654 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/5 <tcp/proto_v1/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/5 (1714 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/6 <tcp/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/6 (1710 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/7 <tcp/proto_v1/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/7 (1829 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/0 <tcp>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/0 (1219 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/1 <tcp/proto_v1>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/1 (1245 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/2 <tcp/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/2 (1232 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/3 <tcp/proto_v1/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/3 (1265 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/4 <tcp/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/4 (1225 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/5 <tcp/proto_v1/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/5 (1241 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/6 <tcp/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/6 (1220 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/7 <tcp/proto_v1/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/7 (1263 ms)
[==========] 16 tests from 1 test suite ran. (23486 ms total)

### patched (this PR)
Note: Google Test filter = tcp/test_ucp_am_nbx_dts.*
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/0 <tcp>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/0 (418 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/1 <tcp/proto_v1>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/1 (416 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/2 <tcp/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/2 (418 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/3 <tcp/proto_v1/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/3 (547 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/4 <tcp/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/4 (371 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/5 <tcp/proto_v1/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/5 (373 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/6 <tcp/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/6 (348 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/7 <tcp/proto_v1/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.short_bcopy_send/7 (347 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/0 <tcp>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/0 (388 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/1 <tcp/proto_v1>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/1 (400 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/2 <tcp/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/2 (410 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/3 <tcp/proto_v1/reply>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/3 (402 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/4 <tcp/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/4 (430 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/5 <tcp/proto_v1/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/5 (445 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/6 <tcp/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/6 (501 ms)
[ RUN      ] tcp/test_ucp_am_nbx_dts.zcopy_send/7 <tcp/proto_v1/reply/errh>
[       OK ] tcp/test_ucp_am_nbx_dts.zcopy_send/7 (443 ms)
[==========] 16 tests from 1 test suite ran. (6658 ms total)

How?

Use progress() as the wait step, as request_wait() already does
(progress() calls sched_yield() after progressing each entity). The
conditions and iteration counts are unchanged, so the tests check the same
things and coverage is the same; they just stop waiting as soon as the
condition holds. Explicit short_progress_loop() calls are not changed.

wait_for_flag() now takes its deadline from ucs::get_deadline(), like
wait_for_value() and the UCT wait helpers, so its timeout scales with the
valgrind/ASan time multiplier.

wait_for_flag() and wait_for_value() checked their condition only
between short_progress_loop() calls. Each loop is 100 progress calls
with a 100 us sleep after every call, so every wait that was not
satisfied on entry took at least ~16 ms.

Check the condition after every progress() call, as request_wait()
does. The conditions and timeouts are unchanged.
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread test/gtest/ucp/ucp_test.h Resolved
Comment thread test/gtest/ucp/ucp_test.h Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

No new test is expected for this change; the validation is a full gtest run. Worth confirming the UCP gtest suite passed in the slow configurations (valgrind, ASan) and not only the default one, because the change also removes the trailing ~10 ms of progress that used to run after the flag was already set — any test implicitly relying on that extra progress would show up only there.

UCT's wait_for_flag/wait_for_value still use short_progress_loop(); if the divergence is intentional, that is fine, but it may be worth a one-line code comment so it is not "fixed" back later.

@dmitrygx
dmitrygx marked this pull request as ready for review November 12, 2026 20:07
@dmitrygx
dmitrygx requested a review from a team as a code owner November 12, 2026 20:07
@svc-ucx

svc-ucx commented Nov 13, 2026

Copy link
Copy Markdown

🤖 CI Triage Agent — UCX PR (Tests new on worker 2) · commit c84e667b

TL;DR: The gtest run failed on a single test, tcp/test_ucp_rma.put_nonblocking/1 <tcp,cuda_copy,rocm_copy/flush_ep>; the endpoint-flush progress loop in src/ucp/rma/flush.c aborts (break) instead of continuing to the remaining lanes when one lane is already pending, so ucp_ep_flush_nbx doesn't flush all lanes in time and the subsequent data validation in test_ucp_memheap::test_xfer fails. Fix is the one in open PR #12266 — keep iterating the other lanes after the pending lane instead of breaking out of the loop.

Full analysis

Summary: Azure job "new on worker 2" (build 144890) failed make test with 1 of 8986 gtests failing: tcp/test_ucp_rma.put_nonblocking/1, variant tcp,cuda_copy,rocm_copy/flush_ep; make: *** [Makefile:5014: test] Error 1.

Root cause: Only the flush_ep variant of the RMA put test fails, and only on TCP (SW-emulated RMA, MAX_RMA_LANES=2, i.e. multiple lanes). In ucp_ep_flush_progress() the lane loop skips the lane owned by the pending callback (next_lanes &= ~UCS_BIT(req->send.lane)), and then, if any other lane returns UCS_ERR_NO_RESOURCE while a flush is already pending on a lane, it does break — leaving the remaining lanes' uct_ep_flush() unstarted for that progress round and only resumable via the pending/slow-path callback. With many queued non-blocking puts on TCP this stalls the endpoint flush, so flush_ep(sender()) in test_ucp_memheap::test_xfer() returns without the puts having landed (the request is released on the gtest deadline), and the following mem_buffer::compare() reports "data validation failed". The PR under test (c84e667, "GTEST/UCP: Check wait condition after every progress call", which changes how often the wait condition is evaluated relative to progress()) only perturbs the progress/wait timing and exposes this latent flush bug — it does not itself move data.

Implicated commit: d513f98 — nbellalou, "UCP/FLUSH: Add topology-safe selective endpoint flush (#11923)" (introduced the lane_mask/started_lanes loop and the pending-lane ownership break). Trigger commit for the CI run: c84e667 (Dmitrii, PR #12242).

File: src/ucp/rma/flush.c:189-196 (break in the UCS_ERR_NO_RESOURCE branch of ucp_ep_flush_progress()); failure surfaces at test/gtest/ucp/test_ucp_memheap.cc:115 via test/gtest/ucp/test_ucp_rma.cc:283.

Suggested fix: In ucp_ep_flush_progress(), when a lane returns UCS_ERR_NO_RESOURCE and req->send.lane != UCP_NULL_LANE, continue to the next lane (keeping the lane unstarted/accounted so it is retried) instead of breaking out of the loop — i.e. adopt the change in PR #12266 "UCP/FLUSH: Flush the other lanes after the pending lane". After that lands, rebase PR #12242 and re-run; if the failure persists, re-run this test alone with UCX_LOG_LEVEL=req to capture the flush ep ... comp_count/started_lanes trace, since the truncated Azure log tail only contains the gtest summary and not the assertion text.

Related: #12266 (fix), #12242 (PR under test), #11923 (selective endpoint flush that introduced the loop)

Use ucs::get_deadline() in wait_for_flag(), as wait_for_value() (through
test_base::wait_for_cond()) and the UCT wait helpers already do, so its
timeout grows with the test time multiplier under valgrind and ASan.
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

@dmitrygx

Copy link
Copy Markdown
Member Author

Re the review summary:

  • ASan: all AddressSanitizer jobs of build 144890 passed. Valgrind is not part of the PR pipeline (valgrind_check: no in buildlib/pr/tests.yml). Besides CI, the UCP suites that call these helpers were run on a ConnectX-7 host in every transport instantiation, plus two extra passes over the callers most likely to depend on the old trailing progress, with no failures from this change (the only aborts were in different_pci_bw_connect, which aborts the same way on master; rdmacm sockaddr variants could not run on that host).
  • The two failures in build 144890 are known master flakes: tcp/test_ucp_rma.put_nonblocking/1 (fixed by UCP/FLUSH: Flush the other lanes after the pending lane #12266; the test does not use these helpers) and the SGL perftest hang on roce worker 2 (fixed by TOOLS/PERF: Fix hang by waiting for late put data and fail on a validation error #12272).
  • The UCT wait helpers are left as is: this PR changes only the UCP fixture.

Comment thread test/gtest/ucp/ucp_test.h
while ((ucs_get_time() < loop_end_limit) && (!(*flag))) {
short_progress_loop();
progress();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe reuse wait_for_cond() here - after this change the deadline+poll loop is exactly what it already does:

Suggested change
}
wait_for_cond([flag]() { return !!(*flag); },
[this]() { progress(); }, timeout);

@tvegas1 tvegas1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@tvegas1
tvegas1 merged commit d59a82b into openucx:master Nov 16, 2026
167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants