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 file socket transport test on Windows #1755

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

schmelter-sap
Copy link
Member

This will not run the FileSocketTransportTest on Windows versions which don't support Unix Domain Sockets.

fixes #1690

@SapMachine
Copy link
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

UnixDomainSocketAddress addr = UnixDomainSocketAddress.of(socketName);

try {
SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's possible to wrap this in a try-with-resources to ensure proper closing of the channel after a successful test?

@SapMachine
Copy link
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

Copy link
Member

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

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

That looks good. I still found two nits... 😄

try (SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX)) {
// Just see if we can create an unix domain socket on Windows.
} catch (UnsupportedOperationException e) {
// Windows version is too old to support unix domain sockets.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a little System.out.println trace would be nice here that one can read in the output what happened.

@@ -93,6 +93,15 @@ public static void main(String[] args) throws Throwable {
System.exit(1);
}

if (Platform.isWindows()) {
try (SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX)) {
// Just see if we can create an unix domain socket on Windows.
Copy link
Member

Choose a reason for hiding this comment

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

I think the correct article here is "a". " ... create a unix domain socket ..."

@SapMachine
Copy link
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@MBaesken
Copy link
Member

This will not run the FileSocketTransportTest on Windows versions which don't support Unix Domain Sockets.

Which Windows version do you thin support it? Is there some minimum version where we expect it to work?

@SapMachine
Copy link
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@RealCLanger RealCLanger merged commit c883b4f into SAP:sapmachine Jul 23, 2024
98 checks passed
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.

None yet

4 participants