-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unit test network.last_contacted (#3285) The unit test network.last_contacted has the following problems: * regular keepalive messages sent automatically can interfere with the test * the test should wait for the clock to move at least one tick to eliminate the possibility of the clock not having the time to move forward * the test waits for a the keepalive counter to be incremented and then expects the last_packet_received timestamp to be updated but the timestamp is updated after the counter is incremented, which is a race condition The solution: * send a second keepalive to handle the race condition between setting the timestamp and incrementing the counter * send a third keepalive to handle the case where an automatic keepalive message is already in flight * wait for the clock to move after reading it and before continuing Assumptions: We assume that there will be no more than 1 keelalive in flight. Of course, in theory, there could be multiple keepalives queued up but for the purposes of this test, we assume max 1 keepalive in flight. It is not an unreasonable assumption in this test case.
- Loading branch information
Showing
3 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters