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

test-azure-win2019-x64-1: jdk_rmi java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java test failure #2133

Closed
lumpfish opened this issue Apr 15, 2021 · 10 comments · Fixed by #2159

Comments

@lumpfish
Copy link

test-azure-win2019-x64-1: jdk_rmi java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java fails on test-azure-win2019-x64-1. It does not fail on test-aws-win2019-x64-1

It fails on openj9 and hotspot, jdk8 jdk11 and jdk16.

Failing job link: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/80/console

To rerun just the failing test

 https://ci.adoptopenjdk.net/job/Grinder/parambuild/?JDK_VERSION=8&JDK_IMPL=hotspot&JDK_VENDOR=adoptopenjdk&BUILD_LIST=openjdk&PLATFORM=x86-64_windows&CUSTOM_TARGET=jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java&TARGET=jdk_custom_1

Several subtests fail with a java.net.MalformedURLException such as:

17:48:20  testing form: rmi://test-win2019dc-/MyName
17:48:20  java.net.MalformedURLException: invalid authority: rmi://test-win2019dc-/MyName
17:48:20  	at java.rmi.Naming.intParseURL(Naming.java:330)
17:48:20  	at java.rmi.Naming.parseURL(Naming.java:237)
17:48:20  	at java.rmi.Naming.rebind(Naming.java:171)
17:48:20  	at LegalRegistryNames.main(LegalRegistryNames.java:89)
17:48:20  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:48:20  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
17:48:20  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
17:48:20  	at java.lang.reflect.Method.invoke(Method.java:498)
17:48:20  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
17:48:20  	at java.lang.Thread.run(Thread.java:748)
17:48:20  	unexpected lookup or unbind exception for form: rmi://test-win2019dc-/MyNameinvalid authority: rmi://test-win2019dc-/MyName

According to https://en.wikipedia.org/wiki/Hostname, hostnames cannot end with a hyphen. On that basis, the test is failing correctly.

The hostname value used in the test is assigned as follows:

localHostName = InetAddress.getLocalHost().getHostName();

So I assume there is something in the configuration of test-azure-win2019-x64-1 which is incorrect - computer name or a registry entry?

@Willsparker
Copy link
Contributor

Having a look now,
Following the steps listed here, I've changed the hostname to remove the hyphen to test-win2019dc, the machine is restarting now for those changes to take effect

@Willsparker
Copy link
Contributor

Machine is back up now, and the name has changed as it should. Rerunning grinder: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/91/console

@Willsparker
Copy link
Contributor

Grinder ran green! Closing issue. Thanks @lumpfish for the comprehensive instructions! 😁

@Willsparker Willsparker self-assigned this Apr 15, 2021
@Willsparker Willsparker added this to the April 2021 milestone Apr 15, 2021
@lumpfish
Copy link
Author

Do we know how / why the hostname was incorrect? Is it the way the machine was given to us, or did we configure it (manually or via ansible)? If it was given to us like that, is there something we could put into ansible to check it's not invalid?

@Willsparker
Copy link
Contributor

AFAIK (and what I could briefly search), we don't set the host-name as part of the playbook (at least, for Windows). I think it's either given to us, or set when the machine is provisioned - however, we could fairly easily add a check in Ansible - It'd just be a case of getting the output of hostname from cmd.exe , and checking it doesn't end in -.

@lumpfish
Copy link
Author

checking it doesn't end in -

"Checking that it's correct" would be better - if we had a notion of what "correct" is.

@sxa
Copy link
Member

sxa commented Apr 15, 2021

The machine, as defined in Azure, is called test-win2019dc-1 which suggests that something has truncated it. Our build machines have a similar hostname convention but prefixed bld rather than test which is one fewer characters. There has historically been a limit on the NetBIOS name of Windows systems, so my guess would be that the azure deployments truncate to 15 characters. test-win2016dc-1 has the same problem (The final 1 is not present). Based on @lumpfish's research it would appear that Azure are deploying systems with invalid hostnames in this case.

@Willsparker I'd suggest test-win2019dc1 or possibly test-win2019-1 would be better to allow for a convention with more than one machine, and I'd also suggest making the same change on the equivalent 2016 machine.

@sxa sxa reopened this Apr 15, 2021
@Willsparker
Copy link
Contributor

Okay, I've renamed test-win2019dc to test-win2019-1, and TEST-WIN2016DC- to TEST-WIN2016-1. Restarted both machines (after checking that nothing was running on them), and they both display the correct names when running hostname in cmd.

"Checking that it's correct" would be better - if we had a notion of what "correct" is.

Well, we could go off the Wikipedia article! From reading it, I gathered the following rules:

  • Maximum of 253 ASCII characters, 63 per label, a label being each section split by a dot (.)
  • Each label can only have a-z,A-Z,0-9 and a hyphen in it, but can't end in a hyphen
  • A label probably shouldn't start with a digit, but definitely shouldn't start with a hyphen

The rules are probably better defined in RFC 1178, but that's a lot of reading.

@sxa
Copy link
Member

sxa commented Apr 16, 2021

I think it's fair to say that most of those scenarios are pretty unlikely. If we really want to do a check I'd be ok with just the - thing since that's the only one that's likely to bite us (Famous last words ... I shouldn't have put this in writing ...)

@Willsparker
Copy link
Contributor

You're a brave man 😅 . I'll look into creating an Ansible task :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants