URL:
https://github.com/SSSD/sssd/pull/947
Title: #947: tests: fix race conditions in integration tests
alexey-tikhonov commented:
"""
I. `test_files_provider.py`
`poll_canary` has no meaning as we currently block when refreshing
the cache. We can either remove it or report a bug against sssd that it behaves
incorrectly. @jhrozek When files provider is updating cache in inotify callback (i.e.
domain is inconsistent) should nss responder A) return not found and let client look in
files database, or B) block until the cache is updated? Currently B is true but tests says
A should be done.
Actually... Are you sure "B is true"?
I just tested with a patch of `providers/files/files_ops.c:sf_passwd_cb()`:
`+ while (1) { usleep(100000); }`
right before `sf_enum_files()` and `id` works fine (according to your statement this
should block).
I checked with `strace`:
```
openat(AT_FDCWD, "/lib64/libnss_sss.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/var/lib/sss/mc/passwd", O_RDONLY|O_CLOEXEC) = 3
connect(4, {sa_family=AF_UNIX, sun_path="/var/lib/sss/pipes/nss"}, 110) = 0
openat(AT_FDCWD, "/lib64/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 5
```
so it falls back to `files`.
Probably reason is call to `dp_sbus_domain_inconsistent()` in the beginning of
`sf_passwd_cb()`?
So I think this part:
> `poll_canary` has no meaning as we currently block when
refreshing the cache. We can either remove it or report a bug against sssd that it behaves
incorrectly.
I agree. This is another known issue with this test.
is void.
This is exactly the reason why it has not been fixed for two+ years.
I am sorry if I am not constructive.
> I see this as a bug in the SSSD (libnss_files.so doesn't
have such an issue).
> And I think hiding this bug in a test is not the best way to deal with it.
Its not a bug, it is a feature
One can call it "design flaw". But regression of user experience at comparison
with default libnss_files is not a "feature" in any way.
It should be remmedied - yes. File a ticket for it.
[4125](https://pagure.io/SSSD/sssd/issue/4125)
When changed, new tests for this change will be written.
...
We are testing current code, not future changes.
Ok, this point of view makes sense.
For what it's worth: here is my ACK for `test_files_provider.py` patch.
II. `test_enumeration.py`
I didn't change my stance here.
So feel free to take over and submit different patch.
Lets see what other will say. If your patch will not be merged I will try my best to
investigate issue and explain `INTERACTIVE_TIMEOUT/2`
"""
See the full comment at
https://github.com/SSSD/sssd/pull/947#issuecomment-561377363