Skip to content

Commit

Permalink
Avoid concurrent modification of vertx list to close
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Sep 17, 2024
1 parent 0ec29db commit ecd187c
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

package io.vertx.tests.eventbus;

import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.impl.Utils;
import io.vertx.test.core.VertxTestBase;
Expand All @@ -33,10 +34,8 @@ public String clusterHost() {
return "127.0.0.3";
}
};
clusteredVertx(new VertxOptions(), clusterManager)
.onComplete(onSuccess(clusteredVertx -> {
assertEquals("127.0.0.3", clusterManager.getNodeInfo().host());
}));
Vertx clusteredVertx = clusteredVertx(new VertxOptions(), clusterManager).await();
assertEquals("127.0.0.3", clusterManager.getNodeInfo().host());
}

@Test
Expand All @@ -52,10 +51,8 @@ public String clusterPublicHost() {
return "127.0.0.3";
}
};
clusteredVertx(new VertxOptions(), clusterManager)
.onComplete(onSuccess(clusteredVertx -> {
assertEquals("127.0.0.3", clusterManager.getNodeInfo().host());
}));
Vertx clusteredVertx = clusteredVertx(new VertxOptions(), clusterManager).await();
assertEquals("127.0.0.3", clusterManager.getNodeInfo().host());
}

@Test
Expand All @@ -73,9 +70,7 @@ public String clusterPublicHost() {
};
VertxOptions options = new VertxOptions();
options.getEventBusOptions().setHost("127.0.0.4");
clusteredVertx(options, clusterManager)
.onComplete(onSuccess(clusteredVertx -> {
assertEquals("127.0.0.4", clusterManager.getNodeInfo().host());
}));
Vertx clusteredVertx = clusteredVertx(options, clusterManager).await();
assertEquals("127.0.0.4", clusterManager.getNodeInfo().host());
}
}

0 comments on commit ecd187c

Please sign in to comment.