cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Intermittent follow_replication test failure #464

Closed ricellis closed 3 years ago

ricellis commented 4 years ago

Please read these guidelines before opening an issue.

Bug Description

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

Run tests.unit.replicator_tests.ReplicatorTests.test_follow_replication

2. What you expected to happen

Test to pass.

3. What actually happened

Test failed with:

[2020-04-14T12:10:17.930Z] FAIL: Test that follow_replication(...) properly iterates updated
[2020-04-14T12:10:17.930Z]----------------------------------------------------------------------
[2020-04-14T12:10:17.930Z] Traceback (most recent call last):
[2020-04-14T12:10:17.930Z]   File "/home/jenkins/workspace/_cloudant_prepare-2.13.0-release/tests/unit/replicator_tests.py", line 417, in test_follow_replication
[2020-04-14T12:10:17.930Z]     self.assertIn(doc.get(state_key), valid_states)
[2020-04-14T12:10:17.930Z] AssertionError: 'initializing' not found in ('completed', 'error', 'triggered', 'running', None)

Environment details

Looks like we need to add initializing to the list of valid states.

ricellis commented 3 years ago

Looks like a timing change has exposed the initializing state that wasn't in the list of valid states (maybe it is a newer addition on the server side, maybe it was just missed out). Either way we should fix this so that we don't have intermittent failures blocking patch releases.