Skip to content

Commit

Permalink
Test failure: com.linecorp.armeria.server.ServerBuilderTest.contextHo…
Browse files Browse the repository at this point in the history
…ok() (#5877)

Motivation:

#5769 

Modifications:

- Added tearDown method with `@AfterEach` in order to reset each count variables used in tests

When executing this test in my local env, this test succeeded and I wasn't sure why this test failure was caused.
But, after adding this tearDown method, we will be able to avoid inappropriate variables staying  in cnt variables.

Result:

- Closes #5769 
- `Test failure: com.linecorp.armeria.server.ServerBuilderTest.contextHook()` will be resolved.
  • Loading branch information
my4-dev authored Sep 23, 2024
1 parent 44fb545 commit 326e747
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.function.Supplier;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -143,6 +144,13 @@ private static Server newServerWithKeepAlive(long idleTimeoutMillis, long pingIn
.build();
}

@AfterEach
void tearDown() {
poppedRouterCnt.set(0);
poppedRouterCnt2.set(0);
poppedCnt.set(0);
}

@Test
void acceptDuplicatePort() throws Exception {
final Server server = Server.builder()
Expand Down

0 comments on commit 326e747

Please sign in to comment.