coreutils
coreutils copied to clipboard
test_sort: Fix timeout issue `test_tmp_files_deleted_on_sigint`
I've seen that test test_sort:;test_tmp_files_deleted_on_sigint
still sometimes fails, in a line where it checks that sort
has created the temporary directory and it exists, so the test fails not finding the temporary directory.
- Wait more for the temporary directory to be created by
sort
. Before the change it slept for 0.1 seconds and right after that asserted ifsort
has created the directory. Sometimessort
didn't manage to create the directory in 0.1 seconds. So the change is: now it tries to wait fortimeout
starting with 0.1 seconds, and if directory was not found, it tries 4 more times, each time increasing the time twice. Once the directory is found it breaks. - Use a new generated file. Before, the sort could work faster and we could be late with sending the signal. Now we create a new big file,
sort
for sure can't process it in a minute, so we can safely wait for the temporary directory to be created and send a signal afterwards. - Use
Pcg32
random number generator to be reproducible