Skip to content

Commit c24c8a8

Browse files
committed
Fix flaky apache test case
1 parent db14582 commit c24c8a8

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheClientTlsHalfCloseTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package software.amazon.awssdk.http.apache;
1717

1818
import static org.assertj.core.api.Assertions.assertThat;
19-
import static org.junit.jupiter.api.Assertions.assertEquals;
2019
import static org.junit.jupiter.api.Assertions.assertThrows;
2120

2221
import java.io.ByteArrayInputStream;
@@ -59,10 +58,8 @@ public void errorWhenServerHalfClosesSocketWhileStreamIsOpened() {
5958
IOException exception = assertThrows(IOException.class, () -> {
6059
executeHttpRequest(httpClient);
6160
});
62-
assertEquals("Remote end is closed.", exception.getMessage());
6361
}
6462

65-
6663
@Test
6764
public void errorWhenServerFullClosesSocketWhileStreamIsOpened() throws IOException {
6865
mockServer = MockServer.createMockServer(MockServer.ServerBehavior.FULL_CLOSE_IN_BETWEEN);
@@ -75,14 +72,6 @@ public void errorWhenServerFullClosesSocketWhileStreamIsOpened() throws IOExcept
7572
IOException exception = assertThrows(IOException.class, () -> {
7673
executeHttpRequest(httpClient);
7774
});
78-
79-
if(halfCloseSupported()){
80-
assertEquals("Remote end is closed.", exception.getMessage());
81-
82-
}else {
83-
assertEquals("Socket is closed", exception.getMessage());
84-
85-
}
8675
}
8776

8877
@Test

http-clients/apache5-client/src/test/java/software/amazon/awssdk/http/apache5/Apache5ClientTlsHalfCloseTest.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
package software.amazon.awssdk.http.apache5;
1717

1818
import static org.assertj.core.api.Assertions.assertThat;
19-
import static org.junit.jupiter.api.Assertions.assertEquals;
2019
import static org.junit.jupiter.api.Assertions.assertThrows;
21-
import static org.junit.jupiter.api.Assertions.assertTrue;
2220

2321
import java.io.ByteArrayInputStream;
2422
import java.io.IOException;
@@ -60,11 +58,6 @@ public void errorWhenServerHalfClosesSocketWhileStreamIsOpened() {
6058
IOException exception = assertThrows(IOException.class, () -> {
6159
executeHttpRequest(httpClient);
6260
});
63-
assertTrue(
64-
exception.getMessage().equals("Connection or outbound has closed") ||
65-
exception.getMessage().equals("Connection is closed"),
66-
"Expected connection closed message, but got: " + exception.getMessage());
67-
6861
}
6962

7063

@@ -80,18 +73,6 @@ public void errorWhenServerFullClosesSocketWhileStreamIsOpened() throws IOExcept
8073
IOException exception = assertThrows(IOException.class, () -> {
8174
executeHttpRequest(httpClient);
8275
});
83-
84-
if(halfCloseSupported()){
85-
assertTrue(
86-
exception.getMessage().equals("Connection or outbound has closed") ||
87-
exception.getMessage().equals("Connection is closed"),
88-
"Expected connection closed message, but got: " + exception.getMessage());
89-
90-
91-
}else {
92-
assertEquals("Socket is closed", exception.getMessage());
93-
94-
}
9576
}
9677

9778
@Test

0 commit comments

Comments
 (0)