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 210773 - EnabledModulesCollectorTest.testSetOfEnabledModulesIsListed() randomly fails
Summary: EnabledModulesCollectorTest.testSetOfEnabledModulesIsListed() randomly fails
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Logger (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: TEST, THREAD
Depends on:
Blocks:
 
Reported: 2012-04-05 12:42 UTC by Martin Entlicher
Modified: 2012-04-06 10:07 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 Martin Entlicher 2012-04-05 12:42:39 UTC
This test depends on threading.
When I put a breakpoint into Installer.writeOut() method and run the test under debugger, it fails after the thread is suspended on the breakpoint.

It randomly fails in the test environment - see http://deadlock.netbeans.org/hudson/job/NB-Core-Build/8102/console

1 tests failed.
REGRESSION:  org.netbeans.modules.uihandler.EnabledModulesCollectorTest.testSetOfEnabledModulesIsListed

Error Message:
One record for disabled and one for enabled: [] expected:<2> but was:<0>

Stack Trace:
junit.framework.AssertionFailedError: One record for disabled and one for enabled: [] expected:<2> but was:<0>
	at org.netbeans.modules.uihandler.EnabledModulesCollectorTest.testSetOfEnabledModulesIsListed(EnabledModulesCollectorTest.java:90)
	at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:95)
	at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:400)
	at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:326)
	at java.lang.Thread.run(Thread.java:662)
Comment 1 Martin Entlicher 2012-04-05 13:19:47 UTC
Apparently, to wait 1s in lastRecord.waitFinished(1000); is not enough.

The waitFinished(1000) is called two times in the test - once from installer.closing() and once from Installer.getLogs(). Thus even 2s wait time is not enough. There is really an extremely slow threads execution on the testing machine.

Why is there the timeout at all? It does not wait till flushed with the timeout, thus breaking the contract.
Comment 2 Martin Entlicher 2012-04-05 13:22:38 UTC
The timeout is changed to indefinite in changeset:   217960:3febf5809ae5
http://hg.netbeans.org/main/rev/3febf5809ae5
Comment 3 Quality Engineering 2012-04-06 10:07:46 UTC
Integrated into 'main-golden', will be available in build *201204060400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fae67f889514
User: mentlicher@netbeans.org
Log: testSetOfEnabledModulesIsListed() marked as @RandomlyFails until issue #210773 is fixed.