mongodb functional tests have race condition due to fixed sleep time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MongoDB Charm |
Fix Released
|
Undecided
|
Mario Splivalo |
Bug Description
The mongodb amulet tests have been variably passing/failing in automation since I began observing them not long ago. This is due to the arbitrary one-time sleep period, apparently intended to allow enough time for the charm and its deployed services to quiesce.
A sleep is not reliable, as the wait time is not always long enough for the charm and replica to settle before tests commence. The amount of time necessary to wait will vary, depending on test rig load, internet speed, and other factors, and is not reliably predictable.
Increasing sleep duration isn't an ideal solution, as it only defers the potential for race, and causes test rigs to be idle and blocking unnecessarily when not under increased load.
Checking that the underlying service is ready, in a polling interval loop with a timeout of several minutes, before testing, would be ideal.
That, and/or implementing extended status and having the charm advertise when it is settled and ready, and only testing once that condition is met.
Related branches
description: | updated |
summary: |
- mongodb functional tests are racey due to fixed sleep time + mongodb functional tests have race condition due to fixed sleep time |
description: | updated |
description: | updated |
Changed in mongodb (Juju Charms Collection): | |
status: | Confirmed → In Progress |
affects: | mongodb (Juju Charms Collection) → mongodb-charm |
FYI, two recent proposals, with automated tests failing in various race windows. In a handful of spot checks of those results, they are failing due to tests jumping the gun.
https:/ /code.launchpad .net/~evarlast/ charms/ trusty/ mongodb/ fix-dump- actions/ +merge/ 277191
https:/ /code.launchpad .net/~tvansteen burgh/charms/ trusty/ mongodb/ use-charm- benchmark- lib/+merge/ 278044