Skip to content

Commit 28c065e

Browse files
committed
Interrupt background processors after five seconds of running.
1 parent 0589e1e commit 28c065e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ public class HumanObjectPeerTestInstance {
251251
let peer2 = Peer(master: self, seed: 2)
252252

253253
connectPeers(peerA: peer1, peerB: peer2)
254+
255+
let semaphore = DispatchSemaphore(value: 0)
256+
DispatchQueue.global(qos: .background).async {
257+
print("waiting five seconds")
258+
sleep(5)
259+
semaphore.signal()
260+
print("finished waiting five seconds")
261+
}
262+
semaphore.wait()
263+
peer1.constructor?.interrupt()
264+
peer2.constructor?.interrupt()
254265
}
255266

256267
}

0 commit comments

Comments
 (0)