The teardown for a context should only fire after the teardown of its contained contexts have finished.
I use teardowns for testing persistence code. The outer context makes the database connection and its teardown disconnects; inner contexts create temporary database structures and their teardowns delete the structures.
(And, yes, I'm aware that it's possible to just leave those structures in place, or what have you. But I think that good unit tests clean up after themselves.)
We've got good support for letting sub-contexts finish most of their work before teardowns happen; let's finish the job.
Here's example code that shows the problem:
I think this is a duplicate of #179, but I like your example better. Will leave this open and close #179.
[fix] Perform teardowns using `async.forEachSeries` with a non-config…
…urable `2000ms` timeout. Fixes #223.
@evanp thought about this a bit more as I fixed it and it is most definitely a breaking change. Fix was committed in 1242b19, and we are just about to release v0.9.x so this should be coming soon.