Ubuntu Pastebin

Paste from babbageclunk at Tue, 6 Jun 2017 23:30:06 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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) {
Download as text