Skip to content

Commit

Permalink
add for test
Browse files Browse the repository at this point in the history
  • Loading branch information
chengyouling committed Dec 12, 2023
1 parent 1ce6c80 commit 1bc75d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void testIsolationResponseHeader() {
successCount.getAndIncrement();
}
} catch (Exception e) {
if (e instanceof HttpServerErrorException && ((HttpServerErrorException) e).getStatusCode().value() == 500) {
if (e instanceof HttpServerErrorException && ((HttpServerErrorException) e).getStatusCode().value() == 503) {
rejectedCount.getAndIncrement();
} else {
LOGGER.warn("testIsolationResponseHeader notExpectedFailed---------------------" + e.getMessage());
Expand All @@ -131,7 +131,7 @@ public void testIsolationResponseHeader() {
+ "-----successCount---" + successCount.get());
Assertions.assertFalse(notExpectedFailed.get());
Assertions.assertEquals(100, rejectedCount.get() + successCount.get());
Assertions.assertTrue(rejectedCount.get() >= 70);
Assertions.assertTrue(rejectedCount.get() >= 80);
Assertions.assertTrue(successCount.get() >= 6);
}

Expand All @@ -158,7 +158,7 @@ public void testIsolationResponseHeaderFeign() {
successCount.getAndIncrement();
}
} catch (Exception e) {
if (e instanceof HttpServerErrorException && ((HttpServerErrorException) e).getStatusCode().value() == 500) {
if (e instanceof HttpServerErrorException && ((HttpServerErrorException) e).getStatusCode().value() == 503) {
rejectedCount.getAndIncrement();
} else {
LOGGER.warn("testIsolationResponseHeader notExpectedFailed---------------------" + e.getMessage());
Expand All @@ -170,7 +170,7 @@ public void testIsolationResponseHeaderFeign() {
+ "-----successCount---" + successCount.get());
Assertions.assertFalse(notExpectedFailed.get());
Assertions.assertEquals(100, rejectedCount.get() + successCount.get());
Assertions.assertTrue(rejectedCount.get() >= 70);
Assertions.assertTrue(rejectedCount.get() >= 80);
Assertions.assertTrue(successCount.get() >= 6);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public void testWebClientInstanceIsolationHeader() throws Exception {
template.getForObject(url + "/testWebClientInstanceIsolationHeader", String.class, invocationID);
successCount.getAndIncrement();
} catch (Exception e) {
LOGGER.warn("testWebClientInstanceIsolationHeader---------------------" + e.getMessage());
if (e instanceof HttpServerErrorException && ((HttpServerErrorException) e).getStatusCode().value() == 500) {
rejectedCount.getAndIncrement();
} else {
Expand Down

0 comments on commit 1bc75d4

Please sign in to comment.