Make sure output lines are fully consumed in tests.

Summary: