Test cleanup during a pending mapping

This commit is contained in:
Arnaud 2026-06-01 18:55:06 +04:00
parent 83d1866877
commit 801445add4
No known key found for this signature in database
GPG Key ID: A6C7C781817146FA

View File

@ -52,6 +52,19 @@ suite "plum":
let r = waitFor createMapping(TCP, 8101, timeout = milliseconds(50))
check r.isErr()
test "cleanup while a createMapping is pending completes cleanly":
require init().isOk()
defer:
discard cleanup()
# No NAT device answers, so the mapping stays PENDING until we cleanup.
let fut = createMapping(TCP, 8501, timeout = milliseconds(200))
waitFor sleepAsync(50.milliseconds)
discard cleanup()
let r = waitFor fut
check r.isErr()
check activeMappingCount() == 0
test "destroyMapping is a no-op on an unknown id":
require init().isOk()
defer: