-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
9c16aec
commit 8680366
Showing
15 changed files
with
180 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Project Keeper 3.0.1, released 2024-01-25 | ||
|
||
Code name: Fixed timeout exception handling | ||
|
||
## Summary | ||
|
||
This release fixes the exception handling for process timeouts. When a started process timed out, PK threw exception `E-PK-CORE-99: Stream reading did not finish after timeout of PT5S` instead of the correct `E-PK-CORE-128: Timeout while waiting 10ms for command '...'.`, hiding the root cause of the problem. | ||
|
||
## Bugfixes | ||
|
||
* #518: Fixed exception handling for process timeouts | ||
|
||
## Dependency Updates | ||
|
||
### Project Keeper Core | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-shared-model-classes:3.0.0` to `3.0.1` | ||
|
||
#### Runtime Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-java-project-crawler:3.0.0` to `3.0.1` | ||
|
||
#### Test Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-shared-test-setup:3.0.0` to `3.0.1` | ||
|
||
### Project Keeper Command Line Interface | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-core:3.0.0` to `3.0.1` | ||
|
||
#### Test Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-shared-test-setup:3.0.0` to `3.0.1` | ||
|
||
### Project Keeper Maven Plugin | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-core:3.0.0` to `3.0.1` | ||
|
||
### Project Keeper Java Project Crawler | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-shared-model-classes:3.0.0` to `3.0.1` | ||
|
||
### Project Keeper Shared Test Setup | ||
|
||
#### Compile Dependency Updates | ||
|
||
* Updated `com.exasol:project-keeper-shared-model-classes:3.0.0` to `3.0.1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,4 +229,4 @@ void installDependencies(final Path projectPath) { | |
.build(); | ||
this.executor.execute(sc, projectPath); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...eeper/src/test/java/com/exasol/projectkeeper/sources/analyze/generic/SimpleProcessIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.exasol.projectkeeper.sources.analyze.generic; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.*; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
import java.time.Duration; | ||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.condition.DisabledOnOs; | ||
import org.junit.jupiter.api.condition.OS; | ||
|
||
// Windows has problems with the timeout of 10ms. Running these tests under Unix is enough. | ||
@DisabledOnOs(OS.WINDOWS) | ||
class SimpleProcessIT { | ||
|
||
private static final Duration TIMEOUT = Duration.ofMillis(10); | ||
|
||
@Test | ||
void outputStream() { | ||
final SimpleProcess process = SimpleProcess.start(List.of("bash", "-c", "echo output")); | ||
process.waitUntilFinished(TIMEOUT); | ||
assertThat(process.getOutputStreamContent(), equalTo("output\n")); | ||
assertThat(process.getErrorStreamContent(), emptyString()); | ||
} | ||
|
||
@Test | ||
void errorStream() { | ||
final SimpleProcess process = SimpleProcess.start(List.of("bash", "-c", ">&2 echo error")); | ||
process.waitUntilFinished(TIMEOUT); | ||
assertThat(process.getOutputStreamContent(), emptyString()); | ||
assertThat(process.getErrorStreamContent(), equalTo("error\n")); | ||
} | ||
|
||
@Test | ||
void outputAndErrorStream() { | ||
final SimpleProcess process = SimpleProcess.start(List.of("bash", "-c", "echo output && >&2 echo error")); | ||
process.waitUntilFinished(TIMEOUT); | ||
assertThat(process.getOutputStreamContent(), equalTo("output\n")); | ||
assertThat(process.getErrorStreamContent(), equalTo("error\n")); | ||
} | ||
|
||
@Test | ||
void processFails() { | ||
final SimpleProcess process = SimpleProcess | ||
.start(List.of("bash", "-c", "echo output && >&2 echo error && exit 1")); | ||
final IllegalStateException exception = assertThrows(IllegalStateException.class, | ||
() -> process.waitUntilFinished(TIMEOUT)); | ||
assertThat(exception.getMessage(), allOf(startsWith( | ||
"E-PK-CORE-126: Failed to run command 'bash -c echo output && >&2 echo error && exit 1' in <null>, exit code was 1 after PT"), | ||
endsWith("Output:\n'output'\n" + // | ||
"Error output:\n'error'"))); | ||
} | ||
|
||
@Test | ||
void processTimeout() { | ||
final SimpleProcess process = SimpleProcess | ||
.start(List.of("bash", "-c", "echo output && >&2 echo error && sleep 1")); | ||
final IllegalStateException exception = assertThrows(IllegalStateException.class, | ||
() -> process.waitUntilFinished(TIMEOUT)); | ||
assertThat(exception.getMessage(), equalTo( | ||
"E-PK-CORE-128: Timeout while waiting 10ms for command 'bash -c echo output && >&2 echo error && sleep 1'. Output was 'output'\n" | ||
+ "Error output: 'error'")); | ||
} | ||
|
||
@Test | ||
void executeFails() { | ||
final List<String> command = List.of("no-such-binary"); | ||
final IllegalStateException exception = assertThrows(IllegalStateException.class, | ||
() -> SimpleProcess.start(command)); | ||
assertThat(exception.getMessage(), equalTo( | ||
"E-PK-CORE-125: Error executing command 'no-such-binary'. Verify that the 'no-such-binary' executable is on the PATH.")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters