test: refactor compose_port_linux_test.go to use Tigron#4713
test: refactor compose_port_linux_test.go to use Tigron#4713ChengyuZhu6 merged 2 commits intocontainerd:mainfrom
Conversation
| @@ -40,22 +38,44 @@ services: | |||
| - "12346:10001/udp" | |||
There was a problem hiding this comment.
Could you please re-write to get host port using portlock package ?
https://github.com/containerd/nerdctl/blob/main/pkg/testutil/portlock/portlock.go
Please correct the affected areas.
Additionally, please verify whether other sections can also be rewritten.
There was a problem hiding this comment.
Thank you for the review.
I've modified TestComposePort and TestComposePortFailure to use the portlock package.
TestComposeMultiplePorts requires consecutive ports, which is difficult to achieve with the portlock package in parallel execution, so I didn't modify it.
| projectName := comp.ProjectName() | ||
| t.Logf("projectName=%q", projectName) |
There was a problem hiding this comment.
Could you write these in testCase.Setup ?
The same applies to other test functions.
There was a problem hiding this comment.
Thank you for the review.
I've added these in testCase.Setup.
2f88384 to
466a0ac
Compare
|
@haytok |
|
|
||
| // TestComposeMultiplePorts tests whether it is possible to allocate a large | ||
| // number of ports. (https://github.com/containerd/nerdctl/issues/4027) | ||
| func TestComposeMultiplePorts(t *testing.T) { |
There was a problem hiding this comment.
Thank you for noticing the improvements to the TestComposeMultiplePorts function.
Since this fix (L175 ~ L180 and L191 ~ L192) doesn't involve refactoring the existing tests in Tigron, should we split the commit?
There was a problem hiding this comment.
Thanks for the suggestion. I've split the commit as suggested.
466a0ac to
d659d97
Compare
|
Please rebase on main branch to pickup the changes. |
Signed-off-by: Hajime Ogi <robertcal900@gmail.com>
Signed-off-by: Hajime Ogi <robertcal900@gmail.com>
d659d97 to
248a714
Compare
|
Thanks for the review. |
related : #4613