fabtests: Add comment clarifying loop invariant in ft_spin_for_comp#12224
fabtests: Add comment clarifying loop invariant in ft_spin_for_comp#12224sunkuamzn wants to merge 1 commit intoofiwg:mainfrom
Conversation
|
bot:aws:retest |
|
@j-xiong is Intel CI failure related? |
|
shm test kept timing out. Could be an infrastructure issue. |
I rebooted the problematic node however, there did not seem to be any issues with it. I will re-run this PR when its back up |
|
I don't think underflow should be logically possible in these loops. |
|
Might be |
|
Seems like it was some weird node issue. I thought there was some bad cleanup of /dev/shm from an earlier run but that location was empty. I don't know why rebooting it fixed the issue but the problematic test just passed. The full run should finish in another 15-20 min |
The do...while loop in ft_spin_for_comp use unsigned subtraction (total - *cur > 0) as the loop condition. This is correct as long as callers maintain the invariant *cur <= total. Document this requirement with a comment. Signed-off-by: Sai Sunku <sunkusa@amazon.com>
816416a to
c539ef0
Compare
|
@alekswn is right. The bug I was chasing was someplace else. I modified the commit to add a comment in case others run into a similar issue in the future. |
The do...while loop in ft_spin_for_comp use unsigned subtraction
(total - *cur > 0) as the loop condition. This is correct as long as
callers maintain the invariant *cur <= total. Document this requirement
with a comment.