coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

test_sort: Fix timeout issue `test_tmp_files_deleted_on_sigint`

Open niyaznigmatullin opened this issue 2 years ago • 0 comments

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 if sort has created the directory. Sometimes sort didn't manage to create the directory in 0.1 seconds. So the change is: now it tries to wait for timeout 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

niyaznigmatullin avatar Sep 12 '22 16:09 niyaznigmatullin