fix(test): wait for the RocketMQ port listener to clear after stop (#16252)

Aligns the parked-port release assertion with the script's own listener check: on a shared pool host a fresh bind probe can fail for a foreign socket or race the killed listener's asynchronous socket release (release run 41708821484, Scripts lane). The sibling case already uses waitForNoListener.

Refs #16248
This commit is contained in:
qwen-code-dev-bot authored and GitHub committed 2026-11-04 14:30:26 +08:00
1 parent 5f0474abc4
commit 4d5e30e6f0
1 file changed
+6 -1
@@ -322,7 +322,12 @@ describe.skipIf(!portLookup)('rocketmq-lite-broker.sh process handling', () => {
for (const port of parked) expect(await isFree(port)).toBe(false);
expect(run('stop', chosen).status).toBe(0);
for (const port of parked) expect(await isFree(port)).toBe(true);
// As with the holders below, check the port's listener the way the
// script does: a bind probe on this shared host can fail for a socket
// this job does not own.
for (const port of parked) {
expect(await waitForNoListener(port)).toBe(true);
}
expect(pidFiles()).toEqual([]);
}, 200_000);