Page MenuHomeSoftware Heritage

test_client: Fix failing test since recent swh-model update
ClosedPublic

Authored by anlambert on Mar 24 2022, 2:34 PM.

Details

Summary

swh.model.tests.swh_model_data.TEST_OBJECTS["revision"] now has
three sample revisions resulting in two revisions being processed
by kafka consumer in test_client_with_deserializer.

As there is no guarantee on the order messages are processed by
kafka consumer, we need to update test implementation to avoid
failures.

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D7422 (id=26861)

Rebasing onto 33a8b959fe...

Current branch diff-target is up to date.
Changes applied before test
commit 4e64c9266870a3cd9ac44b072cc24d500f422974
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 24 14:30:40 2022 +0100

    test_client: Fix failing test since recent swh-model update
    
    swh.model.tests.swh_model_data.TEST_OBJECTS["revision"] now has
    three sample revisions resulting in two revisions being processed
    by kafka consumer in test_client_with_deserializer.
    
    As there is no guarantee on the order messages are processed by
    kafka consumer, we need to update test implementation to avoid
    failures.

Link to build: https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/196/
See console output for more information: https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/196/console

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 24 2022, 2:38 PM
Harbormaster failed remote builds in B27777: Diff 26861!

Build is green

Patch application report for D7422 (id=26862)

Rebasing onto 33a8b959fe...

Current branch diff-target is up to date.
Changes applied before test
commit 3771edbab33dd220c6ec9bf32dee9b10947f55ef
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Mar 24 14:30:40 2022 +0100

    test_client: Fix failing test since recent swh-model update
    
    swh.model.tests.swh_model_data.TEST_OBJECTS["revision"] now has
    three sample revisions resulting in two revisions being processed
    by kafka consumer in test_client_with_deserializer.
    
    As there is no guarantee on the order messages are processed by
    kafka consumer, we need to update test implementation to avoid
    failures.

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

This revision is now accepted and ready to land.Mar 24 2022, 3:13 PM
vlorentz added inline comments.
swh/journal/tests/test_client.py
396–397

simpler and should be equivalent