-
Notifications
You must be signed in to change notification settings - Fork 724
test: refactor compose_up_linux_test.go to use Tigron #4654
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
Conversation
|
I simply rewrote the original test as-is, but the error occurred in TestComposeUpNetWithStaticIP, with details as follows. Details
08:18.6619113Z === �[31mFailed�[0m
2025-12-12T22:08:18.6619358Z === �[31mFAIL�[0m: cmd/nerdctl/compose TestComposeUpNetWithStaticIP (0.24s)
2025-12-12T22:08:18.6619495Z compose_up_linux_test.go:266:
2025-12-12T22:08:18.6619571Z
2025-12-12T22:08:18.6619877Z +============================================================================================================+
2025-12-12T22:08:18.6620432Z | 🧽 | "TestComposeUpNetWithStaticIP": initial cleanup |
2025-12-12T22:08:18.6620732Z +============================================================================================================+
2025-12-12T22:08:18.6620813Z
2025-12-12T22:08:18.6620941Z compose_up_linux_test.go:263:
2025-12-12T22:08:18.6621012Z
2025-12-12T22:08:18.6621384Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6621861Z | ➡️ | ⚙️ /usr/bin/docker compose -f down -v |
2025-12-12T22:08:18.6622229Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6622703Z | | 🚫 command returned a non-zero exit code |
2025-12-12T22:08:18.6623065Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6623452Z | | ⚠️ 1 |
2025-12-12T22:08:18.6623817Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6624372Z | | 🟠 read /tmp/TestComposeUpNetWithStaticIP1452230407/002: is a directory |
2025-12-12T22:08:18.6624800Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6625325Z | 🌱 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin |
2025-12-12T22:08:18.6625757Z | | HOME=/root |
2025-12-12T22:08:18.6626152Z | | XDG_CONFIG_HOME=/home/runner/.config |
2025-12-12T22:08:18.6626533Z | | XDG_RUNTIME_DIR=/run/user/1001 |
2025-12-12T22:08:18.6627070Z | | DOCKER_CONFIG=/tmp/TestComposeUpNetWithStaticIP1452230407/003 |
2025-12-12T22:08:18.6627433Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6627855Z | ⏰ | <1s (limit: 3m0s) |
2025-12-12T22:08:18.6628216Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6628760Z | 📁 | /tmp/TestComposeUpNetWithStaticIP1452230407/002 |
2025-12-12T22:08:18.6629180Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6629314Z
2025-12-12T22:08:18.6629449Z compose_up_linux_test.go:266:
2025-12-12T22:08:18.6629522Z
2025-12-12T22:08:18.6629823Z +============================================================================================================+
2025-12-12T22:08:18.6630326Z | 🏗 | "TestComposeUpNetWithStaticIP": setup |
2025-12-12T22:08:18.6630622Z +============================================================================================================+
2025-12-12T22:08:18.6630700Z
2025-12-12T22:08:18.6630894Z compose_up_linux_test.go:233: projectName="c7434c70"
2025-12-12T22:08:18.6631022Z compose_up_linux_test.go:241:
2025-12-12T22:08:18.6631099Z
2025-12-12T22:08:18.6631460Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6632034Z | ➡️ | ⚙️ /usr/bin/docker compose -f /tmp/TestComposeUpNetWithStaticIP1452230407/001/c7434c70/compose.y |
2025-12-12T22:08:18.6632347Z | | aml up -d |
2025-12-12T22:08:18.6632710Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6633189Z | | 🚫 command returned a non-zero exit code |
2025-12-12T22:08:18.6633550Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6633927Z | | ⚠️ 1 |
2025-12-12T22:08:18.6634286Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6634797Z | | 🟠 Network c7434c70_net0 Creating |
2025-12-12T22:08:18.6635172Z | | Network c7434c70_net0 Error |
2025-12-12T22:08:18.6635733Z | | failed to create network c7434c70_net0: Error response from daemon: invalid pool request: Pool o |
2025-12-12T22:08:18.6636212Z | | verlaps with other one on this address space |
2025-12-12T22:08:18.6636578Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6637104Z | 🌱 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin |
2025-12-12T22:08:18.6637429Z | | HOME=/root |
2025-12-12T22:08:18.6637839Z | | XDG_CONFIG_HOME=/home/runner/.config |
2025-12-12T22:08:18.6638210Z | | XDG_RUNTIME_DIR=/run/user/1001 |
2025-12-12T22:08:18.6638737Z | | DOCKER_CONFIG=/tmp/TestComposeUpNetWithStaticIP1452230407/003 |
2025-12-12T22:08:18.6639101Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6639514Z | ⏰ | <1s (limit: 3m0s) |
2025-12-12T22:08:18.6639875Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6640417Z | 📁 | /tmp/TestComposeUpNetWithStaticIP1452230407/002 |
2025-12-12T22:08:18.6640891Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6640965Z
2025-12-12T22:08:18.6641706Z compose_up_linux_test.go:241: 🔗 �]8;;file:///home/runner/work/nerdctl/nerdctl/cmd/nerdctl/compose/compose_up_linux_test.go#266:1�testCase.Run(t)�]8;;��[0m
2025-12-12T22:08:18.6641782Z
2025-12-12T22:08:18.6641900Z <<<<<<<<<<<<<<<<<<<<
2025-12-12T22:08:18.6642087Z 🖊️ Command should succeed
2025-12-12T22:08:18.6642378Z 👀 testing: `command returned a non-zero exit code`
2025-12-12T22:08:18.6642544Z ❌ FAILED! is `<nil>`
2025-12-12T22:08:18.6642655Z >>>>>>>>>>>>>>>>>>>>
2025-12-12T22:08:18.6642727Z
2025-12-12T22:08:18.6642861Z compose_up_linux_test.go:266:
2025-12-12T22:08:18.6642931Z
2025-12-12T22:08:18.6643232Z +============================================================================================================+
2025-12-12T22:08:18.6643760Z | 🧽 | "TestComposeUpNetWithStaticIP": post-cleanup |
2025-12-12T22:08:18.6644056Z +============================================================================================================+
2025-12-12T22:08:18.6644135Z
2025-12-12T22:08:18.6644261Z compose_up_linux_test.go:263:
2025-12-12T22:08:18.6644332Z
2025-12-12T22:08:18.6644703Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6645266Z | ➡️ | ⚙️ /usr/bin/docker compose -f /tmp/TestComposeUpNetWithStaticIP1452230407/001/c7434c70/compose.y |
2025-12-12T22:08:18.6645691Z | | aml down -v |
2025-12-12T22:08:18.6646052Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6646586Z | 🌱 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin |
2025-12-12T22:08:18.6646917Z | | HOME=/root |
2025-12-12T22:08:18.6647308Z | | XDG_CONFIG_HOME=/home/runner/.config |
2025-12-12T22:08:18.6647751Z | | XDG_RUNTIME_DIR=/run/user/1001 |
2025-12-12T22:08:18.6648227Z | | DOCKER_CONFIG=/tmp/TestComposeUpNetWithStaticIP1452230407/003 |
2025-12-12T22:08:18.6648595Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6649006Z | ⏰ | <1s (limit: 3m0s) |
2025-12-12T22:08:18.6649378Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6656791Z | 📁 | /tmp/TestComposeUpNetWithStaticIP1452230407/002 |
2025-12-12T22:08:18.6657209Z +------------------------------------------------------------------------------------------------------------+
2025-12-12T22:08:18.6657305Z
2025-12-12T22:08:18.6657312Z
2025-12-12T22:08:18.6657459Z DONE 840 tests, 340 skipped, 1 failure in 211.641s
2025-12-12T22:08:19.1702202Z ##[error]Process completed with exit code 1.The crucial point is that the network creation has failed. 🟠 Network c7434c70_net0 Creating
Network c7434c70_net0 Error
failed to create network c7434c70_net0: Error response from daemon: invalid pool request: Pool overlaps with other one on this address space It may appear flaky, but we might need to change it to dynamically obtain the subnet. |
|
I've retried several times, but the test fails at |
|
The subnet used in this test ( Reviewing the CI logs where One is as follows: Details
network_inspect_test.go:402:
2025-12-13T10:48:03.4825715Z
2025-12-13T10:48:03.4826171Z +------------------------------------------------------------------------------------------------------------+
2025-12-13T10:48:03.4827036Z | ➡️ | ⚙️ /usr/bin/docker network inspect testnetworkinspect-display-containers-belonging-to-multiple-n |
2025-12-13T10:48:03.4827776Z | | etwork-f3bc8cbe |
2025-12-13T10:48:03.4828389Z +------------------------------------------------------------------------------------------------------------+
2025-12-13T10:48:03.4829029Z | | 🟢 [ |
2025-12-13T10:48:03.4829589Z | | { |
2025-12-13T10:48:03.4830311Z | | "Name": "testnetworkinspect-display-containers-belonging-to-multiple-network-f3bc8cbe", |
2025-12-13T10:48:03.4831116Z | | "Id": "3704f460860e710a2ed86f24d02c5fcdac346040247ce52a8fd50c1cccd05f5f", |
2025-12-13T10:48:03.4831924Z | | "Created": "2025-12-13T10:48:01.918667019Z", |
2025-12-13T10:48:03.4832529Z | | "Scope": "local", |
2025-12-13T10:48:03.4833211Z | | "Driver": "bridge", |
2025-12-13T10:48:03.4833779Z | | "EnableIPv4": true, |
2025-12-13T10:48:03.4834363Z | | "EnableIPv6": false, |
2025-12-13T10:48:03.4834910Z | | "IPAM": { |
2025-12-13T10:48:03.4835454Z | | "Driver": "default", |
2025-12-13T10:48:03.4835997Z | | "Options": {}, |
2025-12-13T10:48:03.4836525Z | | "Config": [ |
2025-12-13T10:48:03.4837034Z | | { |
2025-12-13T10:48:03.4837559Z | | "Subnet": "172.20.0.0/16", |
2025-12-13T10:48:03.4838119Z | | "Gateway": "172.20.0.1" |
2025-12-13T10:48:03.4838640Z | | } |
2025-12-13T10:48:03.4839122Z | | ] |
2025-12-13T10:48:03.4839602Z | | }, |
2025-12-13T10:48:03.4840124Z | | "Internal": false, |
2025-12-13T10:48:03.4840768Z | | "Attachable": false, |
2025-12-13T10:48:03.4841342Z | | "Ingress": false, |
2025-12-13T10:48:03.4842346Z | | "ConfigFrom": { |
2025-12-13T10:48:03.4843099Z | | "Network": "" |
2025-12-13T10:48:03.4843999Z | | }, |
2025-12-13T10:48:03.4844682Z | | "ConfigOnly": false, |
2025-12-13T10:48:03.4845425Z | | "Containers": { |
2025-12-13T10:48:03.4846422Z | | "b259ec587c3c3ebb28b57a5a22e92744aff04129f6b76d0ecb72f3a52da36482": { |
2025-12-13T10:48:03.4847351Z | | "Name": "testnetworkinspect-display-containers-belonging-to-multiple-network-abb |
2025-12-13T10:48:03.4848276Z | | f04bd", |
2025-12-13T10:48:03.4849030Z | | "EndpointID": "8a96a2ef5419572c392e7c72effa7cd5251c4b80b9bc3cd74b1ce33c7cb9e51e" |
2025-12-13T10:48:03.4849757Z | | , |
2025-12-13T10:48:03.4850432Z | | "MacAddress": "aa:5d:85:de:0c:de", |
2025-12-13T10:48:03.4851233Z | | "IPv4Address": "172.20.0.2/16", |
2025-12-13T10:48:03.4852174Z | | "IPv6Address": "" |
2025-12-13T10:48:03.4852837Z | | } |
2025-12-13T10:48:03.4853336Z | | }, |
2025-12-13T10:48:03.4853964Z | | "Options": {}, |
2025-12-13T10:48:03.4854765Z | | "Labels": {} |
2025-12-13T10:48:03.4855424Z | | } |
2025-12-13T10:48:03.4856000Z | | ] |
2025-12-13T10:48:03.4856585Z +------------------------------------------------------------------------------------------------------------+
2025-12-13T10:48:03.4857669Z | 🌱 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin |
2025-12-13T10:48:03.4858343Z | | HOME=/root |
2025-12-13T10:48:03.4858963Z | | XDG_CONFIG_HOME=/home/runner/.config |
2025-12-13T10:48:03.4859624Z | | XDG_RUNTIME_DIR=/run/user/1001 |
2025-12-13T10:48:03.4860374Z | | DOCKER_CONFIG=/tmp/TestNetworkInspectDisplay_containers_belonging_to_multiple_netw1439837965/003 |
2025-12-13T10:48:03.4861116Z +------------------------------------------------------------------------------------------------------------+
2025-12-13T10:48:03.4862170Z | ⏰ | <1s (limit: 3m0s) |
2025-12-13T10:48:03.4862777Z +------------------------------------------------------------------------------------------------------------+
2025-12-13T10:48:03.4863726Z | 📁 | /tmp/TestNetworkInspectDisplay_containers_belonging_to_multiple_netw1439837965/002 |
2025-12-13T10:48:03.4864461Z +------------------------------------------------------------------------------------------------------------+The other is as follows: Details
These two tests use Docker, but it is thought that the subnet created on the Docker side overlapped with the one on the nerdctl side. Therefore, we will verify operation by ensuring the subnet range does not overlap with the network created by |
|
All the tests I re-wrote this time passed. Therefore, I think they are ready for review. |
| ) | ||
|
|
||
| testCase.Setup = func(data test.Data, helpers test.Helpers) { | ||
| staticIP := "10.4.255.254" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was made to prevent subnets created on the Docker side in another test from overlapping with subnets on the nerdctl side.
As I mentioned briefly below, using the 172.20.0.0/24 subnet causes the error (Error response from daemon: invalid pool request: Pool overlaps with other one on this address space) every time.
I have run CI three times so far, and this error has occurred in TestComposeUpNetWithStaticIP each time.
- https://github.com/containerd/nerdctl/actions/runs/20190915012/job/57968211181
- https://github.com/containerd/nerdctl/actions/runs/20189286123/job/57964376598
- https://github.com/containerd/nerdctl/actions/runs/20178476723/job/57941494520
Therefore, I considered it necessary to avoid this and fixed staticIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw portlock is used to improve parallelism, but some tests may still need NoParallel to address flakiness
Lines 365 to 373 in 20a3eeb
| ## Parallelism | |
| All tests (and subtests) are assumed to be parallelizable. | |
| You can force a specific `test.Case` to not be run in parallel though, | |
| by setting its `NoParallel` property to `true`. | |
| Note that if you want better isolation, it is usually better to use the requirement | |
| `nerdtest.Private` instead of `NoParallel` (see below). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment!
For example, it would be helpful if you could specify exactly where NoParallel is required 🙏
In the tests (TestComposeUp, TestComposeUpBuild, TestComposeUpOsEnvVar, TestComposeUpWithBypass4netns) calling portlock.Acquire(0), only one test is running at a time, so I thought NoParallel: true might not be necessary.
| if projectName := data.Labels().Get("projectName"); projectName != "" { | ||
| helpers.Command("volume", "inspect", fmt.Sprintf("%s_db", projectName)).Run(&test.Expected{ExitCode: 1}) | ||
| helpers.Command("network", "inspect", fmt.Sprintf("%s_default", projectName)).Run(&test.Expected{ExitCode: 1}) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projectName is computed but never saved to labels, causing the logic to be silently skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
Signed-off-by: Hayato Kiwata <[email protected]>
ChengyuZhu6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
testutil.NewBaseto usenerdtest.Setup(Tigron) #4613