8169246: java/net/DatagramSocket/ReportSocketClosed.java fails intermittently with BindException
authorxyin
Fri, 21 Sep 2018 16:13:49 +0800
changeset 51831 ec03768578c2
parent 51830 d2c72de3cf83
child 51832 bf1d479fe7eb
8169246: java/net/DatagramSocket/ReportSocketClosed.java fails intermittently with BindException Reviewed-by: chegar
test/jdk/java/net/DatagramSocket/ReportSocketClosed.java
--- a/test/jdk/java/net/DatagramSocket/ReportSocketClosed.java	Fri Sep 21 15:49:59 2018 +0800
+++ b/test/jdk/java/net/DatagramSocket/ReportSocketClosed.java	Fri Sep 21 16:13:49 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) {