Skip to content

Instantly share code, notes, and snippets.

@finnjohnsen
Last active December 16, 2015 07:38
Show Gist options
  • Save finnjohnsen/5399654 to your computer and use it in GitHub Desktop.
Save finnjohnsen/5399654 to your computer and use it in GitHub Desktop.
void "end jobs should leave no threads"() {
setup:
myService.startJobs()
when:
myService.endJobs()
Thread.sleep(300)
then:
Thread.getAllStackTraces().keySet().findAll \\
{Thread thread -> thread.name.contains "Job"}.size() == 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment