Skip to content

Commit 4d911d4

Browse files
committed
wip
1 parent 60cc84b commit 4d911d4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/com/github/dockerjava/netty/InvocationBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public void run() {
264264
}
265265

266266
// we close the writing side of the socket, but keep the read side open to transfer stdout/stderr
267+
System.out.println("shutdownOutput");
267268
channel.shutdownOutput();
268269

269270
}

src/test/java/com/github/dockerjava/netty/exec/ExecStartCmdExecTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ public void execStartAttachStdin() throws Exception {
137137
.exec(new ExecStartResultCallback(stdout, System.err))
138138
.awaitCompletion(5, TimeUnit.SECONDS);
139139

140-
assertTrue(completed, "The process was not finished.");
141140
assertEquals(stdout.toString("UTF-8"), "STDIN\n");
141+
assertTrue(completed, "The process was not finished.");
142+
142143
}
143144

144145
@Test()
@@ -156,7 +157,7 @@ public void execStartAttachStdinToShell() throws Exception {
156157

157158
dockerClient.startContainerCmd(container.getId()).exec();
158159

159-
InputStream stdin = new ByteArrayInputStream("ls\n".getBytes());
160+
InputStream stdin = new ByteArrayInputStream("ls\nexit\n".getBytes());
160161

161162
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
162163

@@ -201,8 +202,9 @@ public void execStartNotAttachedStdin() throws Exception {
201202
.exec(new ExecStartResultCallback(stdout, System.err))
202203
.awaitCompletion(5, TimeUnit.SECONDS);
203204

205+
assertEquals(stdout.toString(), "");
204206
// with v1.22 of the remote api the server closed the connection when no stdin was attached while exec create, so completed was true
205207
assertFalse(completed, "The process was not finished.");
206-
assertEquals(stdout.toString(), "");
208+
207209
}
208210
}

0 commit comments

Comments
 (0)