make task affinity testing more robust