You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Test(threadPoolSize = 5001, invocationCount = 5002, timeOut = 1000000)
public void testExecute() {
RestTemplate template = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
List<String> cookies = new ArrayList<>();
cookies.add("userPhone=" + "1737467" + Phone++);
headers.put(HttpHeaders.COOKIE, cookies);
HttpEntity request = new HttpEntity(null, headers);
long start = System.currentTimeMillis();
String s = template.postForObject("http://localhost:8080/seckill/1000/bf204e2683e7452aa7db1a50b5713bae/execution", request, String.class);
long end = System.currentTimeMillis();
log.info("{}|{}ms ,res|{}",Thread.currentThread().getId(),(end - start),s);
}
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
The text was updated successfully, but these errors were encountered:
可以使用testng进行并发测试,发现错误
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
The text was updated successfully, but these errors were encountered: