mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
test(iot): wait for the MQTT ports to close around the failed restart (#4533)
* fix(test): wait for the MQTT listeners to close before blocking the TLS port * test(iot): wait for the plain port to close after the failed restart
This commit is contained in:
1 parent
e7e49f9125
commit
f40402fa93
1 file changed
+3
@@ -668,11 +668,14 @@ class IotMqttBrokerServiceTest {
|
||||
void aFailedRestartKeepsRulesOff() throws Exception {
|
||||
broker.startIfEnabled();
|
||||
broker.stop();
|
||||
awaitClosed(plainPort);
|
||||
awaitClosed(tlsPort);
|
||||
try (ServerSocket blocker = new ServerSocket()) {
|
||||
blocker.bind(new InetSocketAddress("127.0.0.1", tlsPort));
|
||||
|
||||
assertThrows(IllegalStateException.class, broker::startIfEnabled);
|
||||
assertFalse(rulesRun(), "a failed restart leaves rules off");
|
||||
awaitClosed(plainPort);
|
||||
}
|
||||
|
||||
broker.startIfEnabled();
|
||||
|
||||
Reference in new issue
Block a user