This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 96416 - Information about passed tests is not available sometimes
Summary: Information about passed tests is not available sometimes
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-02-23 10:24 UTC by Marian Petras
Modified: 2007-02-23 10:36 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2007-02-23 10:24:40 UTC
When repeatedly running the same test class, sometimes both passed and failed
tests are displayed in the results window and sometimes message appears that
information about passed tests is not available. I would expect that for a
particular configuration and test class, either the information is always
available or never available.
Comment 1 Marian Petras 2007-02-23 10:33:52 UTC
Information about passed tests is taken from an XML file generated by the
running tests. Before this file is used, its timestamp is compared with the time
the test started to check that it is the XML file generated by the last test
run. The bug appears if the XML file (report) is generated and saved during the
same second as the test started. For example, test started on

     13:27:18.148   (hh:mm:ss, the last part are milliseconds)

and the file was generated on

     13:27:18.973

The problem is that file's timestamp is not that precise - it does not hold
information about milliseconds. So finally the following timestamps are compared:

   test start:      13:27:18.148
   file timestamp:  13:27:18

The result of this comparison is that the file was last updated earlier than the
test started so the file is obsolete and should not be used.
Comment 2 Marian Petras 2007-02-23 10:36:55 UTC
Fixed in the trunk.

The fix was to ignore the milliseconds part of the test start time and only
compare hours, minutes and seconds.

Modified file:
   junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java   (1.33)

Diff:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java?r1=1.32&r2=1.33&diff_format=u