JDK-4914005 : Regression-test URLConnection/TimeoutTest2.java fails on Tiger.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000,windows_2003
  • CPU: x86
  • Submitted: 2003-08-28
  • Updated: 2003-09-24
  • Resolved: 2003-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Relates :  
Description

Name: vsR10238			Date: 08/28/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b16, b17
Testbase       : Regression-test
Platform[s]    : Windows 2003, Windows XP
Falling test[s]:
         java/net/URLConnection/TimeoutTest2.java

Regression-test java/net/URLConnection/TimeoutTest2.java test fails on Windows with JDK1.5.0-b16, b17.
The test throws ConnectException instead of SocketTimeoutException:

java.net.ConnectException: Connection refused: connect

This is a new test added in the regression test suite for JDK1.5.0-b16 to verify 4700777.
The test cannot be compiled with JDK1.5.0-b15 because java.net.URLConnection.setReadTimeout was
added in b16.

The test passes on other platforms with JDK1.5.0-b16.


Test source location:
=====================
/java/re/jdk/1.5.0/promoted/latest/ws/j2se/test/java/net/URLConnection/TimeoutTest2.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b16/regtest/win32/win2003_linux-19/workDir/test/java/net/URLConnection/TimeoutTest2.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/sh

RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir
JT_HOME="h:/java/jct"
JAVA_HOME="h:/java/jdk1.5.0/win32"
TEST_BASE_PATH="h:/java/regtest.tiger/test"

TESTWITH=$JAVA_HOME
TESTJAVA=$JAVA_HOME

JTOPTS="-client"
TESTVMOPTS="-client"

CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.jar;$JT_HOME/jemmy/jemmy.jar"

export JAVA_HOME
export JT_HOME
export TESTWITH
export CLASSPATH

mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1

#rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

cd $WORK_DIR/scratch

$JAVA_HOME/bin/java -cp $CLASSPATH $JTOPTS -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,windir=$windir,PATH=${SHELL%/*},CPAPPEND=$JT_HOME/jemmy/jemmy.jar,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-19" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/java/net/URLConnection/TimeoutTest2.java"

--- script end ---


Test output (jtr part):
=======================
----------System.out:(0/0)----------
----------System.err:(24/1452)----------
java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.Socket.connect(Socket.java:487)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
	at sun.net.NetworkClient.openServer(NetworkClient.java:122)
	at sun.net.ftp.FtpClient.openServer(FtpClient.java:464)
	at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:245)
	at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:329)
	at TimeoutTest2.test(TimeoutTest2.java:62)
	at TimeoutTest2.main(TimeoutTest2.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:549)

JavaTest Message: Test threw exception: java.net.ConnectException: Connection refused: connect
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.net.ConnectException: Connection refused: connect
result: Failed. Execution failed: `main' threw exception: java.net.ConnectException: Connection refused: connect


test result: Failed. Execution failed: `main' threw exception: java.net.ConnectException: Connection refused: connect


Specific machine info:
======================
Hostname: linux-19
OS: Windows 2003



======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b20 VERIFIED IN: tiger
14-06-2004

EVALUATION Regression tests on timeouts are almost impossible to implement reliably in a cross platform environment. Specially for connect timeouts. Will remove this test. ###@###.### 2003-09-04
04-09-2003