Page MenuHomeSoftware Heritage

test_model: Fix compatibility with pytest-xdist
ClosedPublic

Authored by vlorentz on Dec 15 2021, 2:01 PM.

Details

Summary

Using .now() produces data that differs between xdist processes,
as files are imported after forking, and xdist requires consistent
data across processes.

Diff Detail

Repository
rDMOD Data model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6841 (id=24800)

Rebasing onto 59ed64b08c...

Current branch diff-target is up to date.
Changes applied before test
commit 9b21d2d88f92a641bc2d7d81f445ec554ebcd587
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Dec 15 14:01:20 2021 +0100

    test_model: Fix compatibility with pytest-xdist
    
    Using .now() produces data that differs between xdist processes,
    as files are imported after forking, and xdist requires consistent
    data across processes.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/431/ for more details.

This revision is now accepted and ready to land.Dec 15 2021, 3:10 PM