[Misc] Attempt to fix flickering tests.

(cherry picked from commit ca0b6374663d638fcfe5377f2681869de3968b30)