8251517: [TESTBUG] com/sun/net/httpserver/bugs/B6393710.java does not scale socket timeout

Reviewed-by: dfuchs
This commit is contained in:
Nick Gasson 2020-08-14 18:08:30 +08:00
parent 77522d1270
commit fb300a3ff3

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, 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
@ -24,6 +24,7 @@
/**
* @test
* @bug 6393710
* @library /test/lib
* @summary Non authenticated call followed by authenticated call never returns
* @run main B6393710
* @run main/othervm -Djava.net.preferIPv6Addresses=true B6393710
@ -36,6 +37,8 @@ import java.util.concurrent.*;
import java.io.*;
import java.net.*;
import jdk.test.lib.Utils;
/*
* Test checks for following bug(s) when a POST containing a request body
* needs to be authenticated
@ -80,7 +83,7 @@ public class B6393710 {
server.start ();
Socket s = new Socket (loopback, server.getAddress().getPort());
s.setSoTimeout (5000);
s.setSoTimeout ((int) Utils.adjustTimeout(5000));
OutputStream os = s.getOutputStream();
os.write (cmd.getBytes());
@ -127,8 +130,8 @@ public class B6393710 {
return false;
}
public static boolean ok = false;
static int requests = 0;
public static volatile boolean ok = false;
static volatile int requests = 0;
static class Handler implements HttpHandler {
int invocation = 1;