@@ -99,8 +99,7 @@ public static void main(String[] args) throws Throwable {
9999 try (SocketChannel channel = SocketChannel .open (StandardProtocolFamily .UNIX )) {
100100 // Just see if we can create a unix domain socket on Windows.
101101 } catch (UnsupportedOperationException e ) {
102- System .out .println ("Windows version is too old to support unix domain sockets." );
103- return ;
102+ throw new jtreg .SkippedException ("Windows version is too old to support unix domain sockets." );
104103 }
105104 }
106105
@@ -137,7 +136,7 @@ public static void main(String[] args) throws Throwable {
137136 for (int i = 0 ; i < 3 ; ++i ) {
138137 System .out .println ("Run " + i );
139138 // Wait a bit to let the debugging be set up properly.
140- Thread .sleep (3000 );
139+ Thread .sleep (1000 );
141140 checkSocketPresent (socketName );
142141 read = handshake (socketName , handshake , received );
143142 assertEquals (new String (handshake , "UTF-8" ),
@@ -154,8 +153,16 @@ public static void main(String[] args) throws Throwable {
154153 }
155154 }
156155
157- private static void checkSocketPresent (String name ) {
156+ private static void checkSocketPresent (String name ) throws InterruptedException {
158157 if (!Platform .isWindows ()) {
158+ for (int i = 0 ; i < 10 ; ++i ) {
159+ if (!new File (name ).exists ()) {
160+ Thread .sleep (1000 );
161+ } else {
162+ break ;
163+ }
164+ }
165+
159166 assertTrue (new File (name ).exists (), "Socket " + name + " missing" );
160167 }
161168 }
0 commit comments