Skip to content

TestFactory Create 10000+ tests ,there are need long time time to start test , How to make time shorter #1621

@Nyainqentanglha

Description

@Nyainqentanglha

TestNG Version

Note: only the latest version is supported

6.12

Expected behavior

10000+ tests run ok

Actual behavior

command line log:

开始测试
加载数据开始
加载数据完成
解析数据
创建测试用例:100000

there are need long time time to start test , How to make time shorter

Test case sample

Please, share the test case (as small as possible) which shows the issue

public class TestFactory {
    @Factory
    public Object[] createInstances() {
      Object []tests = new Obejct[100000];
       for(int i=0;i<100000;i++)
          {   test[i] = new Test();}
        return tests;
    }

    /**
     *  测试执行类
     */
    class Test {

        @Test
        protected void test() throws Exception {
          //do test
            return;
        }
    }

main():

           Class[] cls = new Class[1];
             cls[0] = TestFactory.class;
            //初始化测试用例,并设置报告的格式
            TestNG testNG = new TestNG();
            testNG.setTestClasses(cls);
            testNG.setUseDefaultListeners(false);
            logger.info("开始测试");
            testNG.run();
            logger.info("完成测试");

thank you very much

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions