[build] Bulletproofing a test.

(cherry picked from commit 73c60337bb5a99094a954b6dd716fefcaad52cf4)