当前位置:网站首页>The use of invocationcount, threadpoolsize, timeout of concurrent tests in TestNG
The use of invocationcount, threadpoolsize, timeout of concurrent tests in TestNG
2022-07-25 18:04:00 【Martin Luther King】
stay testng The following annotations are used in the annotation to achieve the purpose of concurrent testing , For example, secsha, etc :
invocationCount---- Indicates the number of executions
threadPoolSize----- Indicates the number of threads in the thread pool
timeOut------- Timeout time - millisecond
Code :
import org.testng.annotations.Test;
public class mumu {
private static int i = 0;
@Test(threadPoolSize = 1, invocationCount = 10, timeOut = 1000)
public void ThreadTest() {
++i;
System.out.println("the i is -->" + i);
}
}What is set here is that the threads in each thread pool are 1, But the number of threads depends on CPU The number of
change
threadPoolSize =4
result :
the i is -->3
the i is -->1
the i is -->1
the i is -->2
the i is -->7
the i is -->4
the i is -->5
the i is -->6
the i is -->8
the i is -->9
边栏推荐
- TESTNG中的并发测试invocationCount, threadPoolSize, timeOut的使用
- Polynomial addition
- itextpdf实现多PDF文件合并为一个PDF文档
- 什么是 IP SSL 证书,如何申请?
- SVN客户端(TortoiseSVN)安装及使用说明
- Kendryte K210 在freertos上的lcd屏幕的使用
- mongodb 集群及分片
- Wu Enda's machine learning programming operation cannot be suspended pause problem solved
- 越来越成熟的Rust,都应用了哪些场景呢?
- go channel简单笔记
猜你喜欢

RedisTemplate解决高并发下秒杀系统库存超卖方案 — Redis事务+乐观锁机制

Cloud VR: the next step of virtual reality specialization

nodejs 简单例子程序之express

十九岁的总结

越来越成熟的Rust,都应用了哪些场景呢?

大话DevOps监控,团队如何选择监控工具?

Installation and operation instructions of SVN client (TortoiseSVN)

Cloud XR面临的问题以及Cloud XR主要应用场景

Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"

「行话」| 用DevOps高效交付游戏,是种什么体验?
随机推荐
OSPF --- open shortest priority path protocol
mysql的小数number类型select之后丢失了前面的0
What is an IP SSL certificate and how to apply for it?
Unity 贝塞尔曲线的创建
SVN客户端(TortoiseSVN)安装及使用说明
STM8S003F3 uart的使用
Keil5 “Loading PDSC Debug Description Failed for STMicroelectronics STM32Hxxxxxxx”解决办法
Creation of unity Bezier curve
What are the advantages of real-time cloud rendering
What scenarios have rust, which is becoming more and more mature, applied?
PageHelper还能结合Lambda表达式实现简洁的分页封装
Recommend a qinheng Bluetooth reference blog
Mongodb cluster and sharding
SDLC 软件开发生命周期及模型
绘制pdf表格 (一) 通过itext实现在pdf中绘制excel表格样式并且实现下载(支持中文字体)
推荐一个沁恒的蓝牙的参考博客
直击考点:PMP考试中常见敏捷知识点汇总
Hcip first day experiment
Update 3dcat real time cloud rendering V2.1.2 release
简述聚簇索引、二级索引、索引下推