Commit 66f1246
committed
test(tracker-core): wait for downloads==1 instead of asserting on intermediate state
In `it_should_persist_the_number_of_completed_peers_for_each_torrent_into_the_database`,
the retry loop previously asserted `swarm_metadata.downloads() == 1` on the
first observation. If the background event listener has stored the row but
not yet updated the in-memory `downloads` counter, that assertion would
panic the test instead of letting the bounded `tokio::time::timeout` wait
for the desired state.
Change the check to `if downloads() == 1 { break true }` so the timeout
actually governs the wait and intermediate observations are tolerated.
Addresses Copilot review comment #17 on PR #1718.1 parent fd5be6d commit 66f1246
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | | - | |
95 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
0 commit comments