TestLoginAddsAuditConversationEventually intermittent failure

Bug #1742697 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Anastasia
2.3
Fix Released
High
Witold Krecicki

Bug Description

As seen here:
http://ci.jujucharms.com/job/github-merge-juju/760/console

It would appear we are comparing against a cfg.Clock.Now() but that clock must not be a test clock, because the time difference is exactly 1s. So apparently the clock rolled over just after the code happened.

We should be using a testing clock that only changes time when we want it to.

----------------------------------------------------------------------
[xenial] FAIL: admin_test.go:948: loginSuite.TestLoginAddsAuditConversationEventually
...

[xenial] [LOG] 0:00.304 DEBUG juju.apiserver model login: user-username-7 for deadbeef-0bad-400d-8000-4b1d0d06f00d
[xenial] [LOG] 0:00.312 INFO juju.state new machine "0" has preferred addresses: private "", public ""
[xenial] admin_test.go:992:
[xenial] c.Assert(convo, gc.Equals, auditlog.Conversation{
[xenial] Who: user.Tag().String(),
[xenial] What: "hey you guys",
[xenial] When: cfg.Clock.Now().Format(time.RFC3339),
[xenial] ModelName: s.IAASModel.Name(),
[xenial] ModelUUID: s.IAASModel.UUID(),
[xenial] ConnectionID: "something",
[xenial] ConversationID: "0123456789abcdef",
[xenial] })
[xenial] ... obtained auditlog.Conversation = auditlog.Conversation{Who:"user-username-7", What:"hey you guys", When:"2018-01-11T12:32:05Z", ModelName:"controller", ModelUUID:"deadbeef-0bad-400d-8000-4b1d0d06f00d", ConversationID:"0123456789abcdef", ConnectionID:"something"}
[xenial] ... expected auditlog.Conversation = auditlog.Conversation{Who:"user-username-7", What:"hey you guys", When:"2018-01-11T12:32:06Z", ModelName:"controller", ModelUUID:"deadbeef-0bad-400d-8000-4b1d0d06f00d", ConversationID:"0123456789abcdef", ConnectionID:"something"}

Revision history for this message
Witold Krecicki (wpk) wrote :
Witold Krecicki (wpk)
Changed in juju:
assignee: nobody → Witold Krecicki (wpk)
status: Triaged → Fix Committed
Revision history for this message
Anastasia (anastasia-macmood) wrote :

@Witold Krecicki (wpk),

Did you get a chance to forward port this fix to develop? I have just seen the same failure at http://ci.jujucharms.com/blue/organizations/jenkins/github-merge-juju/detail/github-merge-juju/803/pipeline

Changed in juju:
status: Fix Committed → Triaged
milestone: 2.3.3 → none
Changed in juju:
status: Triaged → In Progress
assignee: Witold Krecicki (wpk) → Anastasia (anastasia-macmood)
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Forward port into develop: https://github.com/juju/juju/pull/8326

Changed in juju:
status: In Progress → Fix Committed
milestone: none → 2.4-beta1
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.