[12] RFR 8169246: java/net/DatagramSocket/ReportSocketClosed.java fails intermittently with BindException

Chris Yin xu.y.yin at oracle.com
Fri Sep 21 06:02:15 UTC 2018


Please review below minor change for 8169246, thanks

The failure log indicate "BindException: Address already in use”, I didn’t see any reason for this test to use a fixed port 4001 that may occupied by others, so propose to just remove fixed port.

bug: https://bugs.openjdk.java.net/browse/JDK-8169246

changes:

diff -r c26fbf1434c4 test/jdk/java/net/DatagramSocket/ReportSocketClosed.java
--- a/test/jdk/java/net/DatagramSocket/ReportSocketClosed.java	Thu Sep 20 14:19:53 2018 -0700
+++ b/test/jdk/java/net/DatagramSocket/ReportSocketClosed.java	Fri Sep 21 13:24:31 2018 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
         byte[]  array = {21,22,23};
 
         try {
-            soc = new DatagramSocket(4001);
+            soc = new DatagramSocket(0);
             sin = InetAddress.getLocalHost();
             soc.close();
         } catch (Exception e) {

Regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180921/7eeb3ba6/attachment.html>


More information about the net-dev mailing list