[pytest-dev] Other plugin breaking usage of pytest-cache

Elijah DeLee kdelee at redhat.com
Fri May 17 11:08:23 EDT 2019


Great, thanks for the leads! I will let you know if I make progress

On Thu, May 16, 2019 at 5:40 PM Bruno Oliveira <nicoddemus at gmail.com> wrote:

> Hi Elijah,
>
>
> On Thu, May 16, 2019 at 6:29 PM Elijah DeLee <kdelee at redhat.com> wrote:
>
>> Reference issue: https://github.com/ansible/pytest-mp/issues/18
>>
>>
>> I'm having trouble knowing where to start looking. Can anyone give me a
>> clue at what point the tests get recorded into the cache?
>>
>
> The last-failed support is done inside cacheprovider in an implementation
> of the pytest_runtest_logreport[1] hook.
>
> The last-failed support works with pytest-xdist, but because there's
> special pytest-xdist handling in the pytest_sessionfinish hook[2]; the
> "hasattr(config, 'slaveinput')"
> is an implementation detail that LFPlugin is using to avoid having the
> workers also trying to write to the cache.
>
> If the problem is indeed that the workers of the pytest-mp plugin are
> trying to write to the cache at the same time, you can check if that's the
> case by inserting a
> "slaveinput" attribute into the config object in the workers, and see if
> that fixes it.
>
> [1]:
> https://github.com/pytest-dev/pytest/blob/master/src/_pytest/cacheprovider.py#L193
> [2]:
> https://github.com/pytest-dev/pytest/blob/master/src/_pytest/cacheprovider.py#L261
>
> Cheers,
> Bruno
>


-- 
Elijah DeLee
------------------
Quality Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20190517/2a062184/attachment-0001.html>


More information about the pytest-dev mailing list