fix flaky test dependent on environment