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

Use ephemeral port to bind on in tests #381

Merged
merged 4 commits into from
May 21, 2019

Conversation

ayyt
Copy link
Contributor

@ayyt ayyt commented May 15, 2019

Use ephemeral port to bind on in tests #260

Sometimes you need a program to bind to a port that can't be hard-coded. Generally this is when you want to run several of them in parallel; if they all bind to port a specified port, only one of them can succeed.

so use system unused ephemeral port

This will close #260

@nebula-community-bot
Copy link
Member

Can one of the admins verify this patch?

Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a better way than the one in the repo. But it's not the perfect one which I've been expecting.

We should pass 0 as the port number to bind on, in which case the OS would choose an available port for us. Then we could retrieve the actually bound port through other interfaces(fortunately, both proxygen and thrift provide such interfaces).

You could investigate such examples in the UTs of the graph and webservice module.

@ayyt
Copy link
Contributor Author

ayyt commented May 15, 2019

This is a better way than the one in the repo. But it's not the perfect one which I've been expecting.

We should pass 0 as the port number to bind on, in which case the OS would choose an available port for us. Then we could retrieve the actually bound port through other interfaces(fortunately, both proxygen and thrift provide such interfaces).

You could investigate such examples in the UTs of the graph and webservice module.

Excellent. I will study it.

@ayyt ayyt force-pushed the use_ephemeral_port branch from c26e8b4 to fea8489 Compare May 15, 2019 13:11
@ayyt
Copy link
Contributor Author

ayyt commented May 16, 2019

This is a better way than the one in the repo. But it's not the perfect one which I've been expecting.

We should pass 0 as the port number to bind on, in which case the OS would choose an available port for us. Then we could retrieve the actually bound port through other interfaces(fortunately, both proxygen and thrift provide such interfaces).

You could investigate such examples in the UTs of the graph and webservice module.

👍

@ayyt ayyt force-pushed the use_ephemeral_port branch 2 times, most recently from 5111b91 to 4c8d3a7 Compare May 16, 2019 08:56
@ayyt
Copy link
Contributor Author

ayyt commented May 16, 2019

Fix and rebase, please review, thx.

@ayyt ayyt force-pushed the use_ephemeral_port branch from 93c2705 to 377914d Compare May 17, 2019 02:05
@@ -148,15 +148,15 @@ struct AddVerticesRequest {
1: common.GraphSpaceID space_id,
// partId => vertices
2: map<common.PartitionID, list<Vertex>>(cpp.template = "std::unordered_map") parts,
// If true, it equals an upsert operation.
// If true, it equals an upset operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upsert means update or insert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. 👍👍

@ayyt ayyt force-pushed the use_ephemeral_port branch from d243575 to 0a89a0f Compare May 17, 2019 07:12
dutor
dutor previously approved these changes May 17, 2019
laura-ding
laura-ding previously approved these changes May 20, 2019
@laura-ding
Copy link
Contributor

jenkins go

@laura-ding laura-ding added the ready-for-testing PR: ready for the CI test label May 20, 2019
@nebula-community-bot
Copy link
Member

Unit testing passed.

@ayyt ayyt dismissed stale reviews from laura-ding and dutor via e6be8aa May 20, 2019 12:29
@ayyt ayyt force-pushed the use_ephemeral_port branch 2 times, most recently from e6be8aa to 5485485 Compare May 20, 2019 12:32
@ayyt
Copy link
Contributor Author

ayyt commented May 20, 2019

Fix conficts and rebase master.

Copy link
Contributor

@dutor dutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done.

@dutor
Copy link
Contributor

dutor commented May 21, 2019

Jenkins go!

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit e0e4de1 into vesoft-inc:master May 21, 2019
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
* Use ephemeral port to bind on in tests

* let the system choose an available port

* rebase master

* address dutor's comments
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
* Use ephemeral port to bind on in tests

* let the system choose an available port

* rebase master

* address dutor's comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ephemeral port to bind on in tests
4 participants