[GitHub] flink pull request #5670: [FLINK-8904][cli][tests] always restore the previo...

2018-03-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/5670


---


[GitHub] flink pull request #5670: [FLINK-8904][cli][tests] always restore the previo...

2018-03-12 Thread NicoK
Github user NicoK commented on a diff in the pull request:

https://github.com/apache/flink/pull/5670#discussion_r173746711
  
--- Diff: 
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestUtils.java
 ---
@@ -65,9 +67,14 @@ public static String getInvalidConfigDir() {
}
 
public static void pipeSystemOutToNull() {
+   previousSysout = System.out;
--- End diff --

That depends on whether we want the restore logic as "restore to previous 
stdout" or "restore to default stdout" - I guess, the latter makes most sense 
indeed and we do not want to encourage any other use.
-> I'll change the commits accordingly


---


[GitHub] flink pull request #5670: [FLINK-8904][cli][tests] always restore the previo...

2018-03-10 Thread zentol
Github user zentol commented on a diff in the pull request:

https://github.com/apache/flink/pull/5670#discussion_r173627882
  
--- Diff: 
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendTestUtils.java
 ---
@@ -65,9 +67,14 @@ public static String getInvalidConfigDir() {
}
 
public static void pipeSystemOutToNull() {
+   previousSysout = System.out;
--- End diff --

Doe it have to be done this way or could we make `previousSysout` final?


---


[GitHub] flink pull request #5670: [FLINK-8904][cli][tests] always restore the previo...

2018-03-09 Thread NicoK
GitHub user NicoK opened a pull request:

https://github.com/apache/flink/pull/5670

[FLINK-8904][cli][tests] always restore the previous sysout when changing 
it in the test

## What is the purpose of the change

Several tests inside the `org.apache.flink.client.cli` package change 
`System.out` to point towards a black whole using 
`CliFrontendTestUtils.pipeSystemOutToNull()` but do not restore the default 
sysout after the test finishes.

## Brief change log

- add a proper restoration of the previous `System.out` by caching it 
during `pipeSystemOutToNull()`

## Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

## Does this pull request potentially affect one of the following parts:

  - Dependencies (does it add or upgrade a dependency): **no**
  - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: **no**
  - The serializers: **no**
  - The runtime per-record code paths (performance sensitive): **no**
  - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: **no**
  - The S3 file system connector: **no**

## Documentation

  - Does this pull request introduce a new feature? **no**
  - If yes, how is the feature documented? **not applicable**


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/NicoK/flink flink-8904

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/5670.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #5670


commit 77cea62307c49cddc9b0699b36dfcb81d52a2f44
Author: Nico Kruber 
Date:   2018-03-09T09:56:31Z

[hotfix][cli][tests] let CliFrontendRunTest extend from TestLogger

commit 49a502f50abf9d351ac0adbb1a78bfbc9f06cd73
Author: Nico Kruber 
Date:   2018-03-06T10:43:32Z

[FLINK-8904][cli][tests] always restore the previous sysout when changing 
it in the test




---