Fix timeout tests that fails sometimes due to inaccurate measurement