URL: https://github.com/SSSD/sssd/pull/25
Title: #25: TESTS: Add integration tests for the proxy provider of sssd-secrets

jhrozek commented:
"""
On Mon, Sep 19, 2016 at 06:54:12AM -0700, lslebodn wrote:
> lslebodn commented on this pull request.
> 
> 
> 
> > +    os.chmod(config.CONF_PATH, stat.S_IRUSR | stat.S_IWUSR)
> +    request.addfinalizer(lambda: os.unlink(config.CONF_PATH))
> +
> +
> +def create_sssd_secrets_fixture(request):
> +    if subprocess.call(['sssd', "--genconf"]) != 0:
> +        raise Exception("failed to regenerate confdb")
> +
> +    resp_path = os.path.join(config.LIBEXEC_PATH, "sssd", "sssd_secrets")
> +
> +    secpid = os.fork()
> +    if secpid == 0:
> +        if subprocess.call([resp_path, "--uid=0", "--gid=0"]) != 0:
> +            raise Exception("sssd_secrets failed to start")
> +
> +    time.sleep(1)
> 
> Is there a reason for this sleep?
> 
> The test passed for me in 0.39 second without it.
> With the sleep it took 2.40 seconds.

I was getting random failures where the socket was not yet ready without
the sleep, like this:
    ConnectionError: ('Connection aborted.', error(2, 'No such file or
    directory'))

I think the test was just too fast. I pushed a new version that instead
tries to connect to the socket and waits 0.2 sec if it cannot. The test
gives up after a second.

"""

See the full comment at 
https://github.com/SSSD/sssd/pull/25#issuecomment-248271267
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to