File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
fluss-server/src/test/java/org/apache/fluss/server/coordinator Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2626import org .junit .jupiter .api .AfterEach ;
2727import org .junit .jupiter .api .BeforeEach ;
2828
29+ import java .time .Duration ;
2930import java .util .Optional ;
3031
32+ import static org .apache .fluss .testutils .common .CommonTestUtils .waitUntil ;
3133import static org .assertj .core .api .Assertions .assertThat ;
3234
3335/** Test for {@link CoordinatorServer} . */
@@ -38,6 +40,7 @@ class CoordinatorServerTest extends ServerTestBase {
3840 @ BeforeEach
3941 void beforeEach () throws Exception {
4042 coordinatorServer = startCoordinatorServer (createConfiguration ());
43+ waitUtilCoordinatorServerElected ();
4144 }
4245
4346 @ AfterEach
@@ -71,4 +74,13 @@ protected void checkAfterStartServer() throws Exception {
7174 optCoordinatorAddr .get ().getEndpoints (),
7275 coordinatorServer .getRpcServer ().getBindEndpoints ());
7376 }
77+
78+ public void waitUtilCoordinatorServerElected () {
79+ waitUntil (
80+ () -> {
81+ return zookeeperClient .getCoordinatorLeaderAddress ().isPresent ();
82+ },
83+ Duration .ofSeconds (10 ),
84+ String .format ("Fail to wait coordinator server reelected" ));
85+ }
7486}
You can’t perform that action at this time.
0 commit comments