substack/node-trumpet — pull request #27 by gsf (2013-12-18 19:55:21+00:00)
Title: Tests to demonstrate strange element order and timing behavior

These tests show that the order of stream ending for data flowing into a trumpet must match the order of elements in that trumpet. For tests where this order does not match, the "end" event is never triggered on the trumpet. Also, if you listen on the "data" event in the out-of-order file tests, note that an extra ">" is appended to the end of the output.

This bug really took me for a ride in one of my projects using trumpet, and I'm just happy to have created tests that reproduce the problem. That's why I'm submitting this without a fix for now. I'll attempt to solve the issue when I have another day to dig in.