Title: #947: tests: fix race conditions in integration tests
Enumeration is run periodically. It is scheduled during SSSD startup and then it runs
every four seconds. We do not know precisely when the enumeration refresh is triggered so
sleeping for four seconds is not enough, we have to sleep longer time to adapt for delays
(it is not scheduled on precise time because of other sssd operation, it takes some time
to finish so each run moves it further away from exact 4 seconds period, cpu scheduler,
context switches, ...). I agree that just little bit longer timeout may work as well.
However we can be sure when using twice the period because we know that enumeration was
indeed run at least once.
I think the `/2` sleep is to wait until the first enumeration is finished. But we would
have to ask the original author.
About files provider tests: I checked if there is a bug that you mentioned and no. There
does not seem to be any bug, though the behavior is not the same as the comment says in
the tests. If the files provider is updating cache, then getpw/gr calls will block (see
flow around `sss_dp_account_files_params`). So there should be no need for polling nor any
kind of sleep. So there is something else going on. I'm disabling memory cache in
tests, lets see if this helps.
See the full comment at https://github.com/SSSD/sssd/pull/947#issuecomment-559440211