T5435 test improvements, see #5435 for details.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>