Handle hash randomisation in test