diff --git a/test/unit_test.c b/test/unit_test.c index 7fa4564a..6099a64c 100644 --- a/test/unit_test.c +++ b/test/unit_test.c @@ -322,11 +322,11 @@ static void test_mqtt(void) { // Connect with empty client ID c = mg_mqtt_connect(&mgr, url, NULL, mqtt_cb, buf); - for (i = 0; i < 100 && buf[0] == 0; i++) mg_mgr_poll(&mgr, 10); + for (i = 0; i < 200 && buf[0] == 0; i++) mg_mgr_poll(&mgr, 10); ASSERT(buf[0] == 'X'); mg_mqtt_sub(c, &topic, 1); mg_mqtt_pub(c, &topic, &data, 1, false); - for (i = 0; i < 100 && buf[1] == 0; i++) mg_mgr_poll(&mgr, 10); + for (i = 0; i < 300 && buf[1] == 0; i++) mg_mgr_poll(&mgr, 10); // LOG(LL_INFO, ("[%s]", buf)); ASSERT(strcmp(buf, "Xx/f12/hi") == 0); @@ -341,11 +341,11 @@ static void test_mqtt(void) { opts.will_topic = mg_str("mg_will_topic"); opts.will_message = mg_str("mg_will_messsage"); c = mg_mqtt_connect(&mgr, url, &opts, mqtt_cb, buf); - for (i = 0; i < 200 && buf[0] == 0; i++) mg_mgr_poll(&mgr, 10); + for (i = 0; i < 300 && buf[0] == 0; i++) mg_mgr_poll(&mgr, 10); ASSERT(buf[0] == 'X'); mg_mqtt_sub(c, &topic, 1); mg_mqtt_pub(c, &topic, &data, 1, false); - for (i = 0; i < 200 && buf[1] == 0; i++) mg_mgr_poll(&mgr, 10); + for (i = 0; i < 500 && buf[1] == 0; i++) mg_mgr_poll(&mgr, 10); ASSERT(strcmp(buf, "Xx/f12/hi") == 0); mg_mgr_free(&mgr);