You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/08/19 15:49:14 UTC
[tomcat] branch 8.5.x updated: Thread safety. Better variable
names. Clear failure message.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 55b51c8 Thread safety. Better variable names. Clear failure message.
55b51c8 is described below
commit 55b51c8ae85d8b7e68b3c92862dacb9602e75eba
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 19 16:47:56 2020 +0100
Thread safety. Better variable names. Clear failure message.
---
test/org/apache/catalina/connector/TestSendFile.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/org/apache/catalina/connector/TestSendFile.java b/test/org/apache/catalina/connector/TestSendFile.java
index 3fca72f..688bcbd 100644
--- a/test/org/apache/catalina/connector/TestSendFile.java
+++ b/test/org/apache/catalina/connector/TestSendFile.java
@@ -22,12 +22,12 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -170,18 +170,18 @@ public class TestSendFile extends TomcatBaseTest {
+ "=true", bc, null);
CountDownLatch latch = new CountDownLatch(2);
- List<Throwable> exceptions = new ArrayList<>();
+ List<Throwable> throwables = new CopyOnWriteArrayList<>();
new Thread(
- new RequestExecutor("http://localhost:" + getPort() + "/test/", latch, exceptions))
+ new RequestExecutor("http://localhost:" + getPort() + "/test/", latch, throwables))
.start();
new Thread(
- new RequestExecutor("http://localhost:" + getPort() + "/test/", latch, exceptions))
+ new RequestExecutor("http://localhost:" + getPort() + "/test/", latch, throwables))
.start();
latch.await(3000, TimeUnit.MILLISECONDS);
- if (exceptions.size() > 0) {
- Assert.fail();
+ if (throwables.size() > 0) {
+ Assert.fail("[" + throwables.size() + "] throwables observed");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org