-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unittest: net: eliminate
ReadTapMock::MockFrame
The test code has two ways to inject a packet to be read from the tap device: Using the `TapTrafficSimulator`, which actually uses `sendto` to send something through the tap device, or `MockFrame`, which hijacks `Net::read_tap` to not actually read from the tap and just return the packet. Eliminate the latter, as it was only used in a single test, and needless complicates the test setup (well, arguably, unittests shouldn't use actual Tap devices, and thus we should eliminte `TapTrafficSimulator` instead, but I'm choosing my battles today). Do the injection of the packet before we deplete the ratelimiter, as otherwise the injection takes long enough for the ratelimiter to replenish, causing the test to fail intermittently. Also increase the replenish time. Signed-off-by: Patrick Roy <[email protected]>
- Loading branch information
Showing
2 changed files
with
30 additions
and
41 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