Make streaming test helpers more bulletproof