Page MenuHomeSoftware Heritage

test_retry: Use proper way to mock sleep of retryable storage methods
ClosedPublic

Authored by anlambert on Oct 19 2022, 2:15 PM.

Details

Summary

Previous implementation was not mocking sleep of retryable storage methods
as the RetryingProxyStorage setup the retry features when it is instantiated.

So modify fixture to ensure sleep functions are mocked and return the mocks
in a dict indexed by storage method names.

This fixes debian buster package build for swh-storage.

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 32466
Build 50847: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 50846: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D8745 (id=31522)

Rebasing onto c1c2dbf01b...

Current branch diff-target is up to date.
Changes applied before test
commit 3c08d9f04f93f48fc36ab12939a0c0d36c02296f
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Oct 19 14:10:15 2022 +0200

    test_retry: Use proper way to mock sleep of retryable storage methods
    
    Previous implementation was not mocking sleep of retryable storage methods
    as the RetryingProxyStorage setup the retry features when it is instantiated.
    
    So modify fixture to ensure sleep functions are mocked and return the mocks
    in a dict indexed by storage method names.
    
    This fixes debian buster package build for swh-storage.

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

This revision is now accepted and ready to land.Oct 19 2022, 2:37 PM