You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2018/08/10 18:21:26 UTC
[geode] branch develop updated: GEODE-5549: Removing assertion
about process exit status from kill test
This is an automated email from the ASF dual-hosted git repository.
upthewaterspout pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 9a4a6c6 GEODE-5549: Removing assertion about process exit status from kill test
9a4a6c6 is described below
commit 9a4a6c6b04d5ec6cdd151547fcbec9f2e0d67aa1
Author: Dan Smith <up...@apache.org>
AuthorDate: Thu Aug 9 14:37:27 2018 -0700
GEODE-5549: Removing assertion about process exit status from kill test
the processTerminatesWhenDestroyedTest was asserting the exit value was
greater than zero. It looks like in some cases it can be 0. Since the
point of the test is to assert what happens to the stream reader
threads, removing this extra assertion.
Co-authored-by: Kirk Lund <kl...@pivotal.io>
---
.../process/BaseProcessStreamReaderIntegrationTest.java | 16 +++++++++++++++-
.../BlockingProcessStreamReaderIntegrationTest.java | 14 --------------
.../NonBlockingProcessStreamReaderIntegrationTest.java | 14 --------------
.../AbstractProcessStreamReaderIntegrationTest.java | 2 +-
4 files changed, 16 insertions(+), 30 deletions(-)
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BaseProcessStreamReaderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BaseProcessStreamReaderIntegrationTest.java
index fb9b987..4af9832 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BaseProcessStreamReaderIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BaseProcessStreamReaderIntegrationTest.java
@@ -45,10 +45,24 @@ public abstract class BaseProcessStreamReaderIntegrationTest
givenRunningProcessWithStreamReaders(ProcessSleeps.class);
// act
- process.destroy(); // results in SIGTERM which usually has an exit code of 143
+ process.destroyForcibly(); // results in SIGTERM which usually has an exit code of 143
// assert
waitUntilProcessStops(10, MINUTES);
assertThatProcessAndReadersDied();
}
+
+ @Test
+ public void capturesStderrWhenProcessFailsDuringStart() throws Exception {
+ // arrange
+ givenStartedProcessWithStreamListeners(ProcessThrowsError.class);
+
+ // act
+ waitUntilProcessStops();
+
+ // assert
+ assertThatProcessAndReadersStoppedWithExitValue(1);
+ assertThatStdOutContainsExactly(ProcessThrowsError.STDOUT);
+ assertThatStdErrContains(ProcessThrowsError.ERROR_MSG);
+ }
}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BlockingProcessStreamReaderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BlockingProcessStreamReaderIntegrationTest.java
index c3e10c0..7670a31 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BlockingProcessStreamReaderIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/BlockingProcessStreamReaderIntegrationTest.java
@@ -109,20 +109,6 @@ public class BlockingProcessStreamReaderIntegrationTest
assertThatStdErrContainsExactly(ProcessPrintsToBoth.STDERR);
}
- @Test
- public void capturesStderrWhenProcessFailsDuringStart() throws Exception {
- // arrange
- givenStartedProcessWithStreamListeners(ProcessThrowsError.class);
-
- // act
- waitUntilProcessStops();
-
- // assert
- assertThatProcessAndReadersStoppedWithExitValue(1);
- assertThatStdOutContainsExactly(ProcessThrowsError.STDOUT);
- assertThatStdErrContains(ProcessThrowsError.ERROR_MSG);
- }
-
@Override
protected ReadingMode getReadingMode() {
return BLOCKING;
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/NonBlockingProcessStreamReaderIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/NonBlockingProcessStreamReaderIntegrationTest.java
index 5ab90e7..a5167f1 100755
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/process/NonBlockingProcessStreamReaderIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/process/NonBlockingProcessStreamReaderIntegrationTest.java
@@ -106,20 +106,6 @@ public class NonBlockingProcessStreamReaderIntegrationTest
assertThatStdErrContainsExactly(ProcessPrintsToBoth.STDERR);
}
- @Test
- public void capturesStderrWhenProcessFailsDuringStart() throws Exception {
- // arrange
- givenStartedProcessWithStreamListeners(ProcessThrowsError.class);
-
- // act
- waitUntilProcessStops();
-
- // assert
- assertThatProcessAndReadersStoppedWithExitValue(1);
- assertThatStdOutContainsExactly(ProcessThrowsError.STDOUT);
- assertThatStdErrContains(ProcessThrowsError.ERROR_MSG);
- }
-
@Override
protected ReadingMode getReadingMode() {
return NON_BLOCKING;
diff --git a/geode-core/src/test/java/org/apache/geode/internal/process/AbstractProcessStreamReaderIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/process/AbstractProcessStreamReaderIntegrationTest.java
index dfca0e7..3a0166d 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/process/AbstractProcessStreamReaderIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/process/AbstractProcessStreamReaderIntegrationTest.java
@@ -96,7 +96,7 @@ public abstract class AbstractProcessStreamReaderIntegrationTest {
}
protected void assertThatProcessAndReadersDied() throws InterruptedException {
- assertThat(process.exitValue()).isGreaterThan(0);
+ assertThat(process.isAlive()).isFalse();
assertThat(stdout.join(READER_JOIN_TIMEOUT_MILLIS).isRunning()).isFalse();
assertThat(stderr.join(READER_JOIN_TIMEOUT_MILLIS).isRunning()).isFalse();
}