testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

'Run Failed Test' doesn't run the proper tests after 2nd rerun when DataProvider is used #148

Closed akracheva closed 8 years ago

akracheva commented 12 years ago

Execute the simple test code bellow:

    @DataProvider(name = "test")
    public Object[][] testDataProvider() {
        List<Object[]> data = new ArrayList<Object[]>();

        data.add(new Object[] { 1 });
        data.add(new Object[] { 2 });
        data.add(new Object[] { 3 });

        return (Object[][]) data.toArray(new Object[data.size()][]);
    }

    @Test(description = "simple test", dataProvider = "test")
    public void testMethod(int test) {
        if( test == 3){
            throw new RuntimeException("Test Case: " + test + " failed!");
        }
    }

Only 3rd test case fails and testing-failed.xml indicates it with invocation-numbers="2". Now rerun failed tests only. The proper test is run and it fails again but testing-failed.xml now indicates it with invocation-numbers="0". So on the next run the 1st test case will be run not the failed one.

Environment: -Eclipse Version: 3.6.2 -TestNG plug-in for Eclipse version 6.3.2.20111203_1323

jith912 commented 10 years ago

HI akracheva/cbeust ,

Is this an issue? or intentionally coded like this.do u have any updates on this?

SapnaBansal commented 10 years ago

I am also stuck at the same point. Is there any update on this

suraj-mac commented 10 years ago

Any updates on this one ?

blackburn-ian commented 8 years ago

Hi @juherr,

Thanks for getting onto this so quickly after my duplicate issue was logged :-) Can you let me know which release this will be included in so I can download the jar and start using it?

Thanks again