Fix a repeat-run failure in setsockopt10#1330
Open
Gaojuxin09 wants to merge 1 commit into
Open
Conversation
setsockopt10 is listed both in runtest/syscalls and runtest/cve. Running the full suite, or running "runltp -s setsockopt10", executes the same test twice in quick succession.
The test currently binds fixed localhost ports 0x7c90 and 0x7c91. The second execution can then fail while the first execution's connection is still in TIME_WAIT:
address is in use, waited 10 sec
TBROK: tst_checkpoint_wait(0, 10000) failed: ETIMEDOUT
Use TST_GET_UNUSED_PORT() for both local TCP sockets so repeated or nearby executions do not depend on fixed ports being immediately reusable.
Signed-off-by: Juxin Gao <gaojuxin@loongson.cn>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a repeat-run failure in setsockopt10.
setsockopt10 is listed in both runtest/syscalls and runtest/cve, so a
full run or
runltp -s setsockopt10executes the same binary twice inquick succession. The test currently binds fixed localhost ports
0x7c90/0x7c91, and the second execution can fail while the previous
connection is still in TIME_WAIT:
Use
TST_GET_UNUSED_PORT()for both test sockets to avoid depending onimmediate reuse of fixed ports.
Validation:
git diff --checkmake -C testcases/kernel/syscalls/setsockopt setsockopt10./runltp -s setsockopt10 -p -qpasses both matched entries