Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky TestVMessDynamicPort #723

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

yuhan6665
Copy link
Member

I will try fixing some flaky tests, start with https://github.com/XTLS/Xray-core/runs/3605024544?check_suite_focus=true
This test can fail randomly for two reasons:

  1. The server core and client core could try to listen on the same port, cause one core fail
  2. The server listen for three ports, some might not be available

To fix first problem, I change it so that server will run first. I open another dokodemo inbound and test it is available before creating the client core.
For 2, I added a loop for server core to try pickPort() for 5 times if it failed.
I also fix the tcpConnAvailableAtPort() method and it is running much faster.

@yuhan6665 yuhan6665 closed this Sep 20, 2021
@teddysun
Copy link
Member

looks good to me

@badO1a5A90
Copy link
Member

非常感谢!

@badO1a5A90 badO1a5A90 merged commit 9f9059c into XTLS:main Sep 24, 2021
@yuhan6665 yuhan6665 deleted the fix-TestVMessDynamicPort branch September 24, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants