Skip to content

Conversation

norio-nomura
Copy link
Contributor

support socat as a listener and writer.

$ ./hack/test-port-forwarding.pl default [nc|socat] [nc|socat]

The nc command always sets SO_REUSEPORT on the listening TCP port.
The socat command provides a reuseport option that enables SO_REUSEPORT on the listening TCP port.

Ref: #4160 (comment)

@norio-nomura norio-nomura force-pushed the test-port-forwarding.pl-use-socat branch 6 times, most recently from fe0fed9 to c18012f Compare October 9, 2025 00:55
@norio-nomura
Copy link
Contributor Author

As far as I can see, tests that failed in nc were also successful in socat.
Is the instability of the port forwarding test caused by nc?

support `socat` as a listener and writer.

```console
$ ./hack/test-port-forwarding.pl default [nc|socat] [nc|socat]
```

The `nc` command always sets `SO_REUSEPORT` on the listening TCP port.
The `socat` command provides a `reuseport` option that enables `SO_REUSEPORT` on the listening TCP port.

Ref: lima-vm#4160 (comment)
Signed-off-by: Norio Nomura <[email protected]>

hack/test-port-forwarding.pl: Add a connection timeout option and relax it from 1 second to 3 seconds.

Signed-off-by: Norio Nomura <[email protected]>
@norio-nomura norio-nomura force-pushed the test-port-forwarding.pl-use-socat branch from c18012f to 6eb6232 Compare October 9, 2025 01:33
@norio-nomura norio-nomura force-pushed the test-port-forwarding.pl-use-socat branch from 360a1fb to 124353a Compare October 9, 2025 02:15
@norio-nomura norio-nomura force-pushed the test-port-forwarding.pl-use-socat branch from 76487b1 to a8100de Compare October 9, 2025 03:34
@jandubois
Copy link
Member

Is the instability of the port forwarding test caused by nc?

I'm just browsing, but this PR still has failing port forwarding tests, e.g. https://github.com/lima-vm/lima/actions/runs/18364708138/job/52315306508?pr=4170. So it looks like switching to socat does not fix them.

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.

2 participants