state_leader_test LeadershipSuite.TestCheck has a race condition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Andrew Wilkins | ||
2.3 |
Fix Released
|
High
|
Andrew Wilkins |
Bug Description
The test asserts that after waiting for the leadership to expire, it will then observe that the leasee does not hold the lock anymore.
My guess is that while its true that the app/0 has lost the lease, it is possible for it to get reacquired before the assertion is run.
The test run here shows the issue:
http://
state_leader_
c.Check(err, gc.ErrorMatches, `"application/0" is not leader of "application"`)
... value = nil
... regex string = "\"application/0\" is not leader of \"application\""
... Error value is nil
state_leader_
c.Check(ops2, gc.IsNil)
... value []txn.Op = []txn.Op{
Note, while this is found by --race, I think that's just an example of it changing the timing of the test. I don't think there is actually a data race, just a false assumption that there isn't anything going on that would renew the leadership.
Though, inserting time.Sleep() doesn't seem to be triggering the issue.
description: | updated |
Changed in juju: | |
assignee: | John A Meinel (jameinel) → Andrew Wilkins (axwalk) |
Changed in juju: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/juju/ juju/pull/ 8154