How to test jobs using XCTest?
henrypratt opened this issue · 4 comments
henrypratt commented
How would you go about testing a job since it is run on a thread that does not notify when it is complete? Right now I am just calling sleep(10) before running my asserts, but I would like to be able to know when an AsyncJob is done.
0xTim commented
How are you running your tests? Have you seen https://github.com/vapor/queues/blob/main/Tests/QueuesTests/AsyncQueueTests.swift?
henrypratt commented
How would this work when using async/await for tests and queues?
0xTim commented
It depends on what your job does but it's mostly the same, just convert futures to a/a code
henrypratt commented
Thanks!