"zpool wait trim" was recently merged into #OpenZFS master.
"zpool wait" provides a mechanism to synchronously wait for completion of long-running pool activities including scrub, resilver, device removal or replacement, block freeing and now manual trim https://t.co/2rKKGEcBG5