Integration tests for scheduler

@peterbourgon  @jmyounker
Use your wait() function here?