make tests not rely on synchronous Platform.flush