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

8246741: NetworkInterface/UniqueMacAddressesTest: mac address uniqueness test failed #1076

Closed
wants to merge 3 commits into from

Conversation

c-cleary
Copy link
Contributor

@c-cleary c-cleary commented Nov 5, 2020

The primary goal of this fix was to refactor NetworkInterface/UniqueMacAddressesTest.java to make use of the jdk.test.lib.NetworkConfiguration class instead of java.net.NetworkInterface. This was due to the original failure being related to the use of the 'awdl' interface on macOS, which should be skipped for functional tests. The NetworkConfiguration class accounts for this when returning the list of present interfaces (originally retrieved using NetworkInterface.getNetworkInterfaces()) as well as for other OS specific properties. The effects of these changes can be seen on L59 and L101-106.

In addition to these changes, some modifications were made to the test in the interest of keeping it concise and readable but were made bearing in mind the original logging of the test was already up to a good standard (and I sought to keep it that way). To summarize the other changes:

  • When using NetworkConfiguration::interfaces to read in a stream of NetworkInterface objects, the objects are collected into a list of records (see JEP 395) to avoid multiple calls to NetworkInterface::getHardwareAddress (which can throw a SocketException) throughout the test.
  • When checking if the MAC addresses are unique, the testMacAddressesEqual() method is not called unless the interface names are different. If testMacAddressesEqual() returns true, the calling method will simply return instead of updating the value of a boolean variable.
  • Majority of logging was moved to the testMacAddressesEqualMethod() so that only logs for comparisons are carried out. There is scope for additional logging of, for example, the list of present interfaces returned by createNetworkInterfaceList() if deemed necessary by review.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

  • JDK-8246741: NetworkInterface/UniqueMacAddressesTest: mac address uniqueness test failed

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1076/head:pull/1076
$ git checkout pull/1076

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 5, 2020

👋 Welcome back ccleary! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 5, 2020

@ccleary-oracle The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Nov 5, 2020
@c-cleary c-cleary marked this pull request as ready for review November 5, 2020 12:55
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 5, 2020
@mlbridge
Copy link

mlbridge bot commented Nov 5, 2020

Webrevs

Copy link
Member

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

LGTM.

@openjdk
Copy link

openjdk bot commented Nov 5, 2020

@c-cleary This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8246741: NetworkInterface/UniqueMacAddressesTest: mac address uniqueness test failed

Reviewed-by: chegar, dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 8 new commits pushed to the master branch:

  • fc894ab: 8255955: Shenandoah: Only STW GC should process concurrent roots at pauses
  • d6f0940: 8255913: Decrease number of iterations in TestMaxCachedBufferSize
  • 1b59595: 8255914: [AOT] Using AOT flag should give warning when AOT is not included in build
  • a50fdd5: 8219014: (bf) Add absolute bulk put methods which accept a source Buffer
  • 3a02578: 8255452: Doing GC during JVMTI MethodExit event posting breaks return oop
  • ba2ff3a: 8250637: UseOSErrorReporting times out (on Mac and Linux)
  • 31918c5: 8255847: Shenandoah: Shenandoah should not mark through weak roots
  • 867a484: 8255214: Unsupported 'valign' attribute for 'th' tag used in j.u.l.LogManager

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@ChrisHegarty, @dfuch) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 5, 2020
@pconcannon
Copy link
Contributor

Great work, Conor. The test looks much better!

Did you consider using testNG? Might help you condense things a bit more

@c-cleary
Copy link
Contributor Author

c-cleary commented Nov 5, 2020

Great work, Conor. The test looks much better!

Did you consider using testNG? Might help you condense things a bit more

Thanks @pconcannon!

I definitely do prefer testNG but was keen not to venture any further away from the scope of the fix than I may already have done with the other modifications. So with that in mind I tried to maintain the same test behavior i.e. throw a RuntimeException on failure instead of some sort of testNG assertion error.

That being said, I am open to updating the test further to make use of testNG if additional feedback warrants it.

@c-cleary
Copy link
Contributor Author

c-cleary commented Nov 5, 2020

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 5, 2020
@openjdk
Copy link

openjdk bot commented Nov 5, 2020

@c-cleary
Your change (at version 770455f) is now ready to be sponsored by a Committer.

@dfuch
Copy link
Member

dfuch commented Nov 6, 2020

/sponsor

@openjdk openjdk bot closed this Nov 6, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 6, 2020
@openjdk
Copy link

openjdk bot commented Nov 6, 2020

@dfuch @c-cleary Since your change was applied there have been 17 commits pushed to the master branch:

  • 688b10b: 8255561: add tests to check binary compatibility rules for records
  • 727a69f: 8255969: Improve java/io/BufferedInputStream/LargeCopyWithMark.java using jtreg tags
  • 952abea: 8254920: Application launched with jpackage produced .exe crashes JVM
  • 5dfb42f: 8255563: Missing NULL checks after JDK-8233624
  • e730e8b: 8241806: The sun/awt/shell/FileSystemViewMemoryLeak.java is unstable
  • 57b98fa: 8255965: LogCompilation: add sort by nmethod code size
  • e42c134: 8255706: The JDWP debug agent unecessarily checks for JVMTI_ERROR_INTERRUPT after calling RawMonitorEnter
  • e66fd6f: 8255756: Disabling logging does unnecessary work
  • 140c162: 8255894: Remove unused StubRoutines::_zero_aligned_words
  • fc894ab: 8255955: Shenandoah: Only STW GC should process concurrent roots at pauses
  • ... and 7 more: https://git.openjdk.java.net/jdk/compare/d3c43c28165d703570ba96e9c557927f23478947...master

Your commit was automatically rebased without conflicts.

Pushed as commit f5d36e6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk-notifier bot referenced this pull request Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

4 participants