Skip to content

Commit

Permalink
Fixes #4070 - Set Piranha Arquillian shutdown timeout to 30 seconds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Oct 20, 2024
1 parent 3b54a4e commit 2cd4470
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void undeploy(Archive<?> archive) throws DeploymentException {
LOGGER.log(INFO, "Waiting for Piranha to be shutdown");

long startTime = System.currentTimeMillis();
process.waitFor(5, TimeUnit.MINUTES);
process.waitFor(30, TimeUnit.SECONDS);
Long finishTime = System.currentTimeMillis();

LOGGER.log(INFO, "Piranha has shutdown\n It took {0} milliseconds", finishTime - startTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ public int read() throws IOException {
if (finished || webApplicationRequest.getContentLength() == 0) {
return -1;
}
read = inputStream.read();
index++;
if (index == webApplicationRequest.getContentLength() || read == -1) {
finished = true;
if (inputStream.available() > 0) {
read = inputStream.read();
index++;
if (index == webApplicationRequest.getContentLength() || read == -1) {
finished = true;
}
}
} else {
if (inputStream.available() > 0) {
Expand Down
6 changes: 3 additions & 3 deletions external/coreprofile-tck/rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ mvn -Dit.test=TestName verify
To run a single test in debug mode, use the following command:

```
mvn -Dmaven.surefire.debug -Dit.test=TestName verify
mvn -Dmaven.failsafe.debug -Dit.test=TestName verify
```

To run a single test in debug mode with a specific port, use the following
command:

```
mvn -Dmaven.surefire.debug -Dmaven.surefire.debug.port=5005 -Dit.test=TestName verify
mvn -Dmaven.failsafe.debug -Dmaven.failsafe.debug.port=5005 -Dit.test=TestName verify
```

To run a single test in debug mode with a specific port and suspend, use the
following command:

```
mvn -Dmaven.surefire.debug -Dmaven.surefire.debug.port=5005 -Dmaven.surefire.debug.suspend=y -Dit.test=TestName verify
mvn -Dmaven.failsafe.debug -Dmaven.failsafe.debug.port=5005 -Dmaven.failsafe.debug.suspend=y -Dit.test=TestName verify
```

To run a single test and put Piranha in debug and susspend mode use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class DefaultHttpServer implements HttpServer {
/**
* Stores the SO_TIMEOUT.
*/
protected int soTimeout;
protected int soTimeout = 60000;

/**
* Stores the SSL flag.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void run() {
while (!server.serverStopRequest) {
try {
Socket socket = server.serverSocket.accept();
socket.setSoTimeout(60000);
server.executorService.execute(new DefaultHttpServerProcessingThread(server, socket));
} catch (IOException exception) {
// not interesting to do anything with this here as the client probably just hung up.
Expand Down

0 comments on commit 2cd4470

Please sign in to comment.