当前位置:网站首页>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
边栏推荐
- "Digital security" alert NFT's seven Scams
- C语言 libcurl交叉编译
- BiSeNet v1
- MySQL数据库常用命令
- Resttemplate realizes the unified encapsulation (printable log) of post, put, delete, get, set request and file upload (batch files and parameters) through generics
- Mock服务moco系列(二)- Json格式、File文件、Header、Cookie、解决中文乱码
- Polynomial addition
- What is an IP SSL certificate and how to apply for it?
- Who is responsible for the problems of virtual idol endorsement products?
- 虚拟偶像代言产品出问题谁负责?
猜你喜欢

Why the future of digitalization depends on 3D real-time rendering

Construction of Huffman tree

使用sqldeveloper连接mysql

云流化和云桌面有什么关系

Wu Enda's machine learning programming operation cannot be suspended pause problem solved

Nineteen year old summary

IDEA集成SVN代码管理常用功能

二叉树的相关操作

Interviewer: talk about log The difference between fatal and panic

「行话」| 用DevOps高效交付游戏,是种什么体验?
随机推荐
Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"
大话DevOps监控,团队如何选择监控工具?
关于云XR介绍,以及5G时代云化XR的发展机遇
Oracle使用impdp导入报错:ORA-39001: 参数值无效 ORA-39000: 转储文件说明错误 ORA-39088: 文件名不能包含路径说明
Oracle导入出错:IMP-00038: 无法转换为环境字符集句柄
C语言 cJSON库的使用
Itextpdf realizes the merging of multiple PDF files into one PDF document
RedisTemplate解决高并发下秒杀系统库存超卖方案 — Redis事务+乐观锁机制
“Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0”问题解决
Type assertion of go interface variables
实时云渲染有哪些优势
专访即构科技李凯:音视频的有趣、行业前沿一直吸引着我
go接口变量的类型断言
H5 test point (mind map)
直击考点:PMP考试中常见敏捷知识点汇总
Tme2022 campus recruitment background development / operation development / business operation and maintenance / application development written examination (I) a little self analysis of programming q
Redis source code and design analysis -- 18. Analysis of redis network connection Library
Creation of unity Bezier curve
mongodb 集群及分片
Installation steps and usage of NVM under windows10 system