Parent: d2588a0 Merge pull request #7454 from burton-swan/inc-2.2.0
Merged: capture-space-info charm-cache close-ports cmr-consume cmr-private-address cmr-relate-direct debug-hook-test-fix (75 more)
Containing: fix-prune-test
Follows: juju-2.2-rc1 (3)
Fix TestPruneLogsBySize
This would occasionally fail because the logs would be pruned down to
below 5000 (since it was slightly above the threshold before
pruning). Instead check that there are more than 2000 records - this
should never be hit. The thing that I was actually concerned with when
adding the check was that there should still be *some* records left in
the collection (that was a bug I introduced while making changes).
1 file changed, 2 insertions(+), 2 deletions(-)
state/logs_test.go | 4 ++--
modified state/logs_test.go
@@ -258,12 +258,12 @@ func (s *LogsSuite) TestPruneLogsBySize(c *gc.C) {
// Logs for second env should be pruned.
c.Assert(s.countLogs(c, s1), jc.LessThan, startingLogsS1)
- c.Assert(s.countLogs(c, s1), jc.GreaterThan, 5000)
+ c.Assert(s.countLogs(c, s1), jc.GreaterThan, 2000)
// Logs for third env should be pruned to a similar level as
// second env.
c.Assert(s.countLogs(c, s2), jc.LessThan, startingLogsS1)
- c.Assert(s.countLogs(c, s2), jc.GreaterThan, 5000)
+ c.Assert(s.countLogs(c, s2), jc.GreaterThan, 2000)
// Ensure that the latest log records are still there.
assertLatestTs := func(st *state.State) {