4

Problem:

When I run a TestNG test using a DataProvider providing a large number of test cases, the Eclipse view for TestNG is not appropriately updated. It stops updating at a random point, and the progress bar indicates that the tests are still running. However, the console shows that all tests have been terminated.

For the MCVE below, I used Eclipse 2019-03 and TestNG 6.14.3, but I'm facing this problem since several years, with different Eclipse versions, different TestNG versions, and on different machines.

MCVE:

import static org.testng.Assert.assertEquals;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class TestNgTest {

    @DataProvider(name="data")
    public final Object[][] getTestData() {

        Object[][] data = new Integer[1000][];

        for (int i=0; i<1000; i++) {
            data[i] = new Integer[]{i, i};
        }
        return data;
    }

    @Test(dataProvider="data")
    public void test(int actual, int expected) {
        assertEquals(actual, expected);
    }
}

Console Output of MCVE:

[RemoteTestNG] detected TestNG version 6.14.3
PASSED: test(0, 0)
PASSED: test(1, 1)
PASSED: test(2, 2)
[...........]
PASSED: test(997, 997)
PASSED: test(998, 998)
PASSED: test(999, 999)

===============================================
    Default test
    Tests run: 1000, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1000, Failures: 0, Skips: 0
===============================================

Output in TestNG-View:

TestNG-View

Anyone facing the same problem? Any ideas how to solve this?

user7291698
  • 1,972
  • 2
  • 15
  • 30

1 Answers1

0

I have tried reproducing this and I haven't been able to do that, using the sample that you have shared.

For what its worth, my project is a Maven project that uses TestNG 7.1.0 as the dependency.

OS : OSX (10.15.2) Eclipse : Version: 2019-03 (4.11.0) Build id: 20190314-1200 TestNG eclipse plugin :

Name : TestNG
Identifier: org.testng.eclipse.feature.group
version: 7.0.0.201908240652

Name : TestNG M2E (Maven) Integration
Identifier: org.testng.eclipse.maven.feature.feature.group
version: 7.0.0.201908240652

Name: TestNG P2 Feature
Identifier: org.testng.p2.feature.feature.group
version: 7.1.0.r202001120626

I dont see the eclipse plugin stall. Please take a look at the attached screenshot below. You could consider upgrading to the versions that I have mentioned (including TestNG)

If this continues to be a problem, I would suggest that you please file a bug in the TestNG eclipse plugin project : https://github.com/cbeust/testng-eclipse

enter image description here

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66