Page MenuHomeSoftware Heritage

Fix tenacious storage tests for swh.model 6
ClosedPublic

Authored by olasd on Mar 23 2022, 4:35 PM.

Details

Summary

The logic for testing the tenacious storage proxy by interspersing bad
objects with good ones triggers when the object list is larger than 3
items. However, the allowed error rate of 1 failure for a window of 3
objects would only work for lists larger than six objects (putting at
least 2 good objects between each bad object).

swh.model 6 made the directory, revision and release test object lists 3
object long, triggering the buggy code.

Reducing the window size to 2 objects makes the test logic works for
lists of 3 or more objects.

Depends on D7399 (kinda, I pulled these commits because I need them for mypy)

Test Plan

pytest

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz accepted this revision.

Depends on D7399 (kinda, I pulled these commits because I need them for mypy)

And for other tests to pass

This revision is now accepted and ready to land.Mar 23 2022, 4:38 PM

Build is green

Patch application report for D7417 (id=26833)

Rebasing onto 92c78ab547...

Current branch diff-target is up to date.
Changes applied before test
commit 835feb684295f3dd0cf7ccd00ecd3c2b9f1e59e0
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Mar 23 16:29:59 2022 +0100

    Fix tenacious storage tests for swh.model 6
    
    The logic for testing the tenacious storage proxy by interspersing bad
    objects with good ones triggers when the object list is larger than 3
    items. However, the allowed error rate of 1 failure for a window of 3
    objects would only work for lists larger than six objects (putting at
    least 2 good objects between each bad object).
    
    swh.model 6 made the directory, revision and release test object lists 3
    object long, triggering the buggy code.
    
    Reducing the window size to 2 objects makes the test logic works for
    lists of 3 or more objects.

commit 6fdaf8a05d6955dfd53c76d0ceec9226040d9ca8
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 21 15:46:43 2022 +0100

    Remove typing workarounds for Revision.author or Revision.committer being None
    
    swh-model 6.0.0 adds proper support for them.
    
    + fix issue found by mypy

commit 3eff720a0c2cabb756a4635bb107659cae3e903a
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Mar 21 15:18:20 2022 +0100

    Add support for author=None and committer=None
    
    committer=None happens on some malformed commits generated by old dgit
    version; and it is possible for author=None to happen for the same reason.
    
    For now, this is not supported by swh-model, so tests temporarily
    disable attrs checks that swh-model relies on.

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