| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…coverage Follow-up to #2225. Two test-quality fixes for the O(n) iterator-remove reap: cleanerReapsExpiredButKeepsHealthyInSameTick used a 200ms idle window with the fresh channels offered immediately before firing the cleaner, so a GC/scheduling pause on a loaded CI box could age them past the timeout and get them wrongly reaped. Widen the window to 1s (mirrors channelReofferedAfterExpiryIsNotReaped) so only a pause longer than the window can misclassify a fresh channel. Add cleanerContinuesPastRemovedNodesToReachKeptNodes. Because offer() is offerFirst and that mixed test's fresh channels cluster at the front, every reaped node sat at the tail, so the scan never had to unlink a node and then advance to a KEPT node after it. The new test builds an alternating closed/open deque through the remote-close path (channels are closed, not aged, so it is fully deterministic) so each removed node is followed by a kept one, pinning the iterator-remove-then-continue guarantee.
| Back | FazBrowse Home | New Git URL |
Motivation:
#2225 replaced DefaultChannelPool's collect-then-removeAll reap with an in-place O(n) iterator removal, but two test gaps remained. First, cleanerReapsExpiredButKeepsHealthyInSameTick used a 200 ms idle timeout, making it susceptible to GC or scheduling delays that could incorrectly classify fresh channels as expired. Second, because offer() inserts at the front of the deque, the test never exercised the iterator-removal case where iteration must continue correctly after removing a node.
Modification:
Increase the idle timeout in the mixed test to 1 second, matching channelReofferedAfterExpiryIsNotReaped, to eliminate the tight timing dependency. Add cleanerContinuesPastRemovedNodesToReachKeptNodes, which deterministically constructs an alternating closed/open deque so every removed node is immediately followed by a retained one, directly validating the iterator-remove-then-continue behavior. Test-only; no production changes.
Result:
The test suite is no longer sensitive to timing jitter and now deterministically verifies the iterator removal logic introduced in #2225.