I think the problem was related to t.plan causing the test to end before s.close.