Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout setting not working in parallel="tests" mode #811

Closed
michael-yxf opened this issue Sep 24, 2015 · 0 comments
Closed

timeout setting not working in parallel="tests" mode #811

michael-yxf opened this issue Sep 24, 2015 · 0 comments

Comments

@michael-yxf
Copy link

When the attribute parallel is set to "tests", the suite level timeout doesn't work as expected, although the main thread report that the test finished already, but the individual tests actually still keep running until the end.

With parallel="tests" mode, the test level timeout just get ignored by using the default timeout value - infinity.

Communicated with Krishnan Mahadevan in groups, and use simple example from him below, you can also try suite-level timeout setting to reproduce the issue:

public class TimeOuts {
    @Test (timeOut = 1000)
    public void myTestMethod() {
        try {
            System.err.println("Commencing sleep");
            Thread.sleep(1500);
            System.err.println("Sleep completed");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        TestNG testNG = new TestNG();
        testNG.setVerbose(2);
//         testNG.setParallel("tests");
        // If setParallel("tests") is commented out then timeout happens else there are
        // no timeouts.
        testNG.setTestClasses(new Class[] {TimeOuts.class});
        String version = new File(TestNG.class.getProtectionDomain().getCodeSource()
            .getLocation().getFile()).getParentFile().getName();
        System.err.println("TestNG Version : " + version);
        testNG.run();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants