diff --git a/tests/test_etcp_multipath.c b/tests/test_etcp_multipath.c index d782206b..d6807d56 100644 --- a/tests/test_etcp_multipath.c +++ b/tests/test_etcp_multipath.c @@ -222,6 +222,8 @@ static void run_for(unsigned ms, int sending, const char* phase) { test_clock_poll(ua, 10); for (int i = 0; i < 2; i++) CHECK(ep[i].conn->state != 2 && !ep[i].conn->reinit_pending); if (get_time_us() >= next_snapshot) { snapshot(phase); next_snapshot = get_time_us() + 100000; } + if (!sending && ep[0].sent == ep[1].received && ep[1].sent == ep[0].received && + !ep[0].conn->unacked_bytes && !ep[1].conn->unacked_bytes) break; } } @@ -291,8 +293,9 @@ static uint64_t measure_rate(const struct profile* settings, unsigned count, uns expect(useful >= capacity * 85 / 100, "application goodput >=85% capacity", useful, capacity * 85 / 100); } measuring = 0; - run_for(5000, 0, "drain"); - for (int i = 0; i < 2; i++) CHECK(ep[i].sent == ep[1-i].received); + run_for(10000, 0, "drain"); + for (int i = 0; i < 2; i++) expect(ep[i].sent == ep[1-i].received, "complete ordered delivery after drain", + ep[1-i].received, ep[i].sent); teardown(); return rate; } @@ -354,8 +357,9 @@ static void stalled(const struct profile* settings, unsigned count, unsigned bro measuring = 0; for (unsigned p = 0; p < count; p++) if (broken & (1u << p)) for (unsigned dir = 0; dir < 2; dir++) CHECK(dummynet_set_mode(channels[p], dir, DUMMYNET_RUN) == 0); - run_for(3000, 1, "recovery"); run_for(5000, 0, "drain"); - for (int i = 0; i < 2; i++) CHECK(ep[i].sent == ep[1-i].received); + run_for(3000, 1, "recovery"); run_for(10000, 0, "drain"); + for (int i = 0; i < 2; i++) expect(ep[i].sent == ep[1-i].received, "complete delivery after recovery", + ep[1-i].received, ep[i].sent); teardown(); }