tests: wait until the res file exists before comparing it

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>