URL: https://github.com/SSSD/sssd/pull/947
Title: #947: tests: fix race conditions in integration tests

alexey-tikhonov commented:
"""
> 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, ...). 

Right, I agree.

> 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.

We have to have 
```
INTERACTIVE_TIMEOUT > "REAL"_ENUMERATION_TIMEOUT,
```
where REAL_ENUMERATION_TIMEOUT = ENUMERATION_TIMEOUT + some non deterministic 
`delay`.
But:
1) strictly speaking there is no guarantee `delay` < ENUMERATION_TIMEOUT (but 
otherwise of course would be insane environment)
 2) I think ENUMERATION_TIMEOUT as an estimation of this `delay` is too much. 
This would not be a problem if intg-tests would not consume that long time to 
run...

tl,dr: I'm not categorically against estimation of  REAL_ENUMERATION_TIMEOUT as 
2*ENUMERATION_TIMEOUT.
But IMO this has nothing to do with Nyquist frequency and this is still 
arbitrary  (just "good enough with a very good margin") value.

> I think the `/2` sleep is to wait until the first enumeration is finished. 

To be sure that there is really no entry in ldap before test adds it? Makes 
sense.
But:
1) why then it is /2? As discussed above that's not enough even with this 
patch. And it was clearly too small for this purpose before, so intention of 
this timeout is still not clear to me.
2) do we really need this in the beginning of every test? I am not sure if sssd 
restarted in every test or once for the whole module?

It is 5*(INTERACTIVE_TIMEOUT/2) = 20 seconds for each run (or twice if we 
remove /2). Doesn't sound like too much but things add up. And CI runs are 
really slow...
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/947#issuecomment-559457158
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to