Add polling to functional tests