Issue Details (XML | Word | Printable)

Key: DERBY-459
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dag H. Wanvik
Reporter: Dag H. Wanvik
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

lang/errorStream.java fails intermittently on Windows 2003 server

Created: 14/Jul/05 03:38 AM   Updated: 05/Oct/05 11:11 PM
Return to search
Component/s: Test
Affects Version/s: 10.1.2.1, 10.2.1.6
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works 459.cmd 2005-09-08 04:25 PM Dag H. Wanvik 0.1 kB
File Licensed for inclusion in ASF works 459.diff 2005-07-14 09:18 AM Dag H. Wanvik 0.5 kB
File Licensed for inclusion in ASF works 459.stat 2005-07-14 09:18 AM Dag H. Wanvik 0.1 kB
Environment: Windows 2003 server, J2SE 1.4.2

Resolution Date: 05/Oct/05 11:11 PM


 Description  « Hide
Philips spotted this problem on a Windows 2003 server:

(mail quote):

I ran derbyall on a new machine and the lang/errorStream.java test
fails. I've run the same test successfully on 3 other machines and the
only discernable difference I am able to come up with is the operating
system (XP vs Windows 2003 Server on the failing machine). Also the
error in question seems to suggest that the problem is with an empty log
file, I've also attached a copy of that non empty log file. At this
point I'm open to suggestions.

Philip
------------------ Java Information ------------------
Java Version: 1.4.2_08
Java Vendor: Sun Microsystems Inc.
Java home: c:\j2sdk1.4.2_08\jre
Java classpath: .;c:\derby\derbyMain\classes;c:\derby\db2jcc.jar;c:\derby\db2jcc_license_c.jar;C:\derby\derbyMain\tools\java\jakarta-oro-2.0.8.jar;C:\derby\derbyMain\tools\java\geronimo-spec-servlet-2.4-rc4.jar;C:\j2sdk1.4.2_08\lib\tools.jar;.;C:\j2sdk1.4.2_08\lib;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\java\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;C:\IBM\SQLLIB\bin;C:\IBM\SQLLIB\java\common.jar
OS name: Windows 2003
OS architecture: x86
OS version: 5.2
Java user name: db2admin
Java user home: C:\Documents and Settings\db2admin
Java user dir: C:\Derby\derbyMain\singleTest
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[C:\Derby\derbyMain\classes] 10.2.0.0 alpha - (1)
[C:\Derby\db2jcc.jar] 2.4 - (17)
[C:\Derby\db2jcc_license_c.jar] 2.4 - (17)
[C:\IBM\SQLLIB\java\db2jcc.jar] 2.4 - (17)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale : [English/United States [en_US]]
Found support for locale: [de_DE]
version: 10.2.0.0 alpha - (1)
Found support for locale: [es]
version: 10.2.0.0 alpha - (1)
Found support for locale: [fr]
version: 10.2.0.0 alpha - (1)
Found support for locale: [it]
version: 10.2.0.0 alpha - (1)
Found support for locale: [ja_JP]
version: 10.2.0.0 alpha - (1)
Found support for locale: [ko_KR]
version: 10.2.0.0 alpha - (1)
Found support for locale: [pt_BR]
version: 10.2.0.0 alpha - (1)
Found support for locale: [zh_CN]
version: 10.2.0.0 alpha - (1)
Found support for locale: [zh_TW]
version: 10.2.0.0 alpha - (1)
------------------------------------------------------
Framework: embedded
*** Start: errorStream jdk1.4.2_08 2005-07-13 11:24:44 ***
4 del
< shutdown ok: XJ015:Derby system shutdown.
5 del
< shutdown ok: XJ015:Derby system shutdown.
6 del
< shutdown ok: XJ015:Derby system shutdown.
7 del
< shutdown ok: XJ015:Derby system shutdown.
8 del
< shutdown ok: XJ015:Derby system shutdown.
9 del
< shutdown ok: XJ015:Derby system shutdown.
10 del
< shutdown ok: XJ015:Derby system shutdown.
11 del
< shutdown ok: XJ015:Derby system shutdown.
12 del
< Test errorStream finished successfully
12 add
> Test errorStream failed: assertNonEmpty failed:C:\Derby\derbyMain\singleTest\errorStream\VombatusUrsinusHirsutus-err-2.log
> org.apache.derbyTesting.functionTests.tests.lang.AssertException: assertNonEmpty failed:C:\Derby\derbyMain\singleTest\errorStream\VombatusUrsinusHirsutus-err-2.log
Test Failed.
*** End: errorStream jdk1.4.2_08 2005-07-13 11:24:48 ***
2005-07-13 14:24:46.671 GMT Thread[main,5,main] java.io.FileNotFoundException: C:\Derby\derbyMain\singleTest\errorStreamfoo\VombatusUrsinusHirsutus-file-2.log (The system cannot find the path specified)
----------------------------------------------------------------
2005-07-13 14:24:46.687 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.2.0.0 alpha - (1): instance c013800d-0105-1095-564f-00004167747a
on database directory C:\Derby\derbyMain\singleTest\errorStream\VombatusUrsinusHirsutus-2

Database Class Loader started - derby.database.classpath=''

2005-07-13 14:24:47.468 GMT:
Shutting down instance c013800d-0105-1095-564f-00004167747a
----------------------------------------------------------------


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dag H. Wanvik added a comment - 14/Jul/05 03:47 AM
This a race condition. When the test closes the current log (on
System.err in this case) by redirecting it to
System.out., it seems the underlying file isnt closed immediately.
When the file is subsequently checked, the check for non-empty
races ahead of the actual closing of the file (notice in Philip's log the
 file is indeed not empty, it is just the assert which fails).

An explicit close solved the problem on Philips machine. Posting the patch
as soon as i have run some more tests.


Dag H. Wanvik added a comment - 14/Jul/05 09:18 AM
Patch which fixes the problem; thanks to Philip for finding this and trying the patch.
It now works on Windows 2003. I also ran derbyall on Solaris 9, JDK 1.4.2 (no errors) and Windows XP
to check against regression. The latter has several errors, but run correctly for this test.

Dag H. Wanvik made changes - 14/Jul/05 09:18 AM
Field Original Value New Value
Attachment 459.stat [ 12311226 ]
Attachment 459.diff [ 12311227 ]
Dag H. Wanvik made changes - 14/Jul/05 09:36 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Daniel John Debrunner added a comment - 14/Jul/05 10:30 AM
I don't think bugs should be marked as fixed until their patch is committed.

Dag H. Wanvik added a comment - 15/Jul/05 12:17 AM
Keep open until committed.

Dag H. Wanvik made changes - 15/Jul/05 12:17 AM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Repository Revision Date User Message
ASF #219265 Fri Jul 15 23:57:07 UTC 2005 djd DERBY-459 - Close error stream to make lang/errorStream test consistent.

Contributed by Dag H. Wanvik dag.wanvik@sun.com
Files Changed
MODIFY /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java

Daniel John Debrunner added a comment - 16/Jul/05 08:57 AM
Committed revision 219265.

Dag H. Wanvik made changes - 16/Jul/05 10:19 AM
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Philip Wilder added a comment - 02/Sep/05 01:19 AM
Any thought of porting this patch to 10.1? I just ran derbyall on the 10.1 branch and this came up.

Dag H. Wanvik added a comment - 08/Sep/05 04:15 PM
Back-port patch to the 10.1 branch

Dag H. Wanvik made changes - 08/Sep/05 04:15 PM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Dag H. Wanvik added a comment - 08/Sep/05 04:25 PM
uploaded a svn merge-command which will port the patch for this issue.
(assumed current directory is 10.1). I have run derby-all with no errors.

Dag H. Wanvik made changes - 08/Sep/05 04:25 PM
Attachment 459.cmd [ 12312777 ]
Repository Revision Date User Message
ASF #294922 Tue Oct 04 21:26:12 UTC 2005 bandaram Merge fix for DERBY-459 from TRUNK.

DERBY-459 - Close error stream to make lang/errorStream test consistent.

Contributed by Dag H. Wanvik dag.wanvik@sun.com
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream.java

Dag H. Wanvik added a comment - 05/Oct/05 07:48 PM
Ported to 10.1

Dag H. Wanvik made changes - 05/Oct/05 07:48 PM
Status Reopened [ 4 ] Closed [ 6 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Fix Version/s 10.1.2.0 [ 12310270 ]
Resolution Fixed [ 1 ]
Dag H. Wanvik added a comment - 05/Oct/05 11:10 PM
correcting the "Fixed in" to include both trunk and 10.1

Dag H. Wanvik made changes - 05/Oct/05 11:10 PM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Dag H. Wanvik added a comment - 05/Oct/05 11:11 PM
updated Fix Version to show bug has been fixed in both 10.1.2.0 and trunk

Dag H. Wanvik made changes - 05/Oct/05 11:11 PM
Resolution Fixed [ 1 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Status Reopened [ 4 ] Closed [ 6 ]