ringbuilder tests are fragile

Bug #1499015 reported by John Dickinson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
Unassigned

Bug Description

in ringbuilder unit tests, test_warn_at_risk and test_no_warn_when_balanced test that errors are returned (or not) in certain balanced and unbalanced situations. However, it's testing this by creating a ring with certain magic numbers for part power (or a rebalance seed) to get something that is likely to balance or not.

A better plan would be to create a ring that is absolutely unbalanced (or mock it) so that we can be more explicit about what is being tested and have something that's more consistently testable locally and in the gate

Tags: ring
tags: added: ring
Revision history for this message
Alistair Coles (alistair-coles) wrote :

AFAICT the existing tests always pass but could be prone to changes in the builder rebalance. The goal of the test is to verify the ringbuilder behavior, not the builder behavior, so on that basis I agree with the bug, however minor.

Changed in swift:
status: New → Confirmed
Revision history for this message
Alistair Coles (alistair-coles) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/502503
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=079be1d5cddcaafbae0cae983cd908bac351d33b
Submitter: Jenkins
Branch: master

commit 079be1d5cddcaafbae0cae983cd908bac351d33b
Author: Alistair Coles <email address hidden>
Date: Mon Sep 11 11:08:37 2017 -0600

    Mock RingBuilder.rebalance when testing ringbuilder cli warnings

    Use mock to force explicit RingBuilder rebalance results so that the
    test is focussed on the ringbuilder.py rebalance command behavior
    when balance is (or is not) achieved. Avoids assumptions about
    RingBuilder behavior.

    Change-Id: I242ffc2f1a4f7b69a679832a65790223642dcea8
    Closes-Bug: #1499015

Changed in swift:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.16.0

This issue was fixed in the openstack/swift 2.16.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.