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 223996

Summary: junit test runner lists/sorts results on event handling thread
Product: java Reporter: kalle1
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED FIXED    
Severity: normal CC: theshadow27
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 235055    
Bug Blocks:    

Description kalle1 2012-12-18 20:12:22 UTC
The JUnit graphical test runner which displays the results of tests which are executed using the context menu of a test class entry in the project tree "does some activity" (I assume sorting or retrieving stack information for test failures) on the event handling thread which causes NetBeans to freeze when it's dealing with high number of parameterized test cases (> 60k). It's an unusual high number indicating bad testing practice, one should be able to able to cancle the task though. The issue is reproducable when including and afterwards excluding passed test form the list using the icon buttons on the left panel of the test runner.
Comment 1 kalle1 2012-12-18 20:24:08 UTC
To reproduce prepare your IDE to freeze (!) and execute the following test using the context menu of the file in the project section, switch to the test result tab, press show passed tests and then hide pass test:
<code>
package org.h9t2.mavenproject3;

import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class AppTest {
	
	public AppTest( String testName ) {
	}

	@Parameterized.Parameters
	public static List<Object[]> generateTestData() {
		return Collections.nCopies(60000, new Object[] {"aTestName"});
	}

	@Test
	public void testApp() {
	}
}
</code>
Comment 2 Theofanis Oikonomou 2013-05-28 14:19:02 UTC
*** Bug 228227 has been marked as a duplicate of this bug. ***
Comment 3 theshadow27 2013-05-28 15:54:53 UTC
Same issue on OS X, and windows. Changing to all platforms. 

It happens for smaller numbers of tests (~5k) in practice (not sure why), even without using parameterized, when running tests on an entire project at once (navigator -> Projects -> project context -> Test) .
Comment 4 theshadow27 2013-08-26 21:21:41 UTC
I am able to reproduce this with as few as 3k tests (<<<60k) in a recent dev build (201308182300) see Bug 235055
Comment 5 Jan Peska 2013-08-27 08:04:10 UTC
*** Bug 235055 has been marked as a duplicate of this bug. ***
Comment 6 Theofanis Oikonomou 2013-12-05 15:05:39 UTC
The problem was that the children of a suite node were computed on EDT. Now they are created off EDT. Filtering buttons are disabled during running execution of tests. When really a lot tests are to be displayed a "Please wait" node is show and then when nodes are created/updated they are shown.
Comment 7 Theofanis Oikonomou 2013-12-05 15:10:46 UTC
Changeset: b9d585b24a9b
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2013-12-05 16:03
Message: