Skip to content

Conversation

@emlowe
Copy link
Contributor

@emlowe emlowe commented Dec 8, 2025

This test didn't work properly as the time_out_asserts were not awaited (but rather asserted - I'm assuming a typo - but this was not checked by linting)

Once changed to proper await one of the checks didn't work at all, so I adjusted the code somewhat to rely on parsing LOG messages

Discovered during Python 3.14 testing which has better checks for missing awaits


Note

Refactors the long untrusted sync test to properly await async asserts, verify disconnect via logs, and remove manual cancel flag for reliable behavior.

  • Tests (chia/_tests/wallet/sync/test_wallet_sync.py):
    • Refactor test_long_sync_untrusted_break:
      • Replace manual cancel/sleep with await peer.wait_until_closed() and remove sync_canceled logic.
      • Properly await time_out_assert(...) calls and assert start_client(...) results.
      • Capture logs (caplog.at_level(INFO)) and assert disconnect messages, including connection-closed details.
      • Ensure only trusted peer remains using awaited assertion and verify trusted sync state.

Written by Cursor Bugbot for commit 9d2af5c. This will update automatically on new commits. Configure here.

@emlowe emlowe requested a review from a team as a code owner December 8, 2025 22:10
@emlowe emlowe added CI CI changes Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog labels Dec 8, 2025
@emlowe emlowe requested a review from AmineKhaldi December 8, 2025 22:12
Copy link
Contributor

@AmineKhaldi AmineKhaldi left a comment

Choose a reason for hiding this comment

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

Nicely done.

)
# And that we only have a trusted peer left
assert time_out_assert(30, only_trusted_peer)
await time_out_assert(30, only_trusted_peer)
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I see I think they just had a thinko about asserting only_trusted_peer's return (which happens by default in time_out_assert) and asserting time_out_assert instead.

@emlowe emlowe requested a review from arvidn December 9, 2025 15:44
@emlowe emlowe mentioned this pull request Dec 9, 2025
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI CI changes Fixed Required label for PR that categorizes merge commit message as "Fixed" for changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants