Skip to content

Auto stopping scheduler when all jobs are done #653

Answered by husam-e
husam-e asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @JohnRoesler, thanks for the suggestions and timely response!

I need a "black box" way to test the job, as I can't modify it to do something extra for my test, and I didn't want to purely rely on time as that can be non deterministic since I don't know how long each job run will take.

You motivated me to find another way that just requires control of the Scheduler which I'm injecting into the test, using event listeners where I push to a buffered channel in an after job run listener, then wait by pulling from the channel the number of times I expect the job to run. This seems reliable and is working.

Cheers!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@husam-e
Comment options

Answer selected by husam-e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants