Skip to content

Commit

Permalink
Makes a slight modification to the arrangement of
Browse files Browse the repository at this point in the history
TestRemoteRelationProviderRoleConsumingSide around the arg copying for
macaroon comparison. We observed panics in CI testing.
  • Loading branch information
manadart committed Oct 18, 2023
1 parent 6dd3be0 commit 326f79b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions worker/firewaller/firewaller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,18 +1038,19 @@ func (s *InstanceModeSuite) TestRemoteRelationProviderRoleConsumingSide(c *gc.C)
c.Check(version, gc.Equals, 0)
c.Check(id, gc.Equals, "")
c.Check(request, gc.Equals, "WatchEgressAddressesForRelations")

rArgs := arg.(params.RemoteEntityArgs)
newMac := rArgs.Args[0].Macaroons[0]
apitesting.MacaroonEquals(c, newMac, mac)

rArgs.Args[0].Macaroons = nil
expected := params.RemoteEntityArgs{
Args: []params.RemoteEntityArg{{
Token: relToken,
}},
}
// Extract macaroons so we can compare them separately
// (as they can't be compared using DeepEquals due to 'UnmarshaledAs')
rArgs := arg.(params.RemoteEntityArgs)
newMacs := rArgs.Args[0].Macaroons
rArgs.Args[0].Macaroons = nil
apitesting.MacaroonEquals(c, newMacs[0], mac)
c.Check(arg, gc.DeepEquals, expected)

c.Assert(result, gc.FitsTypeOf, &params.StringsWatchResults{})
*(result.(*params.StringsWatchResults)) = params.StringsWatchResults{
Results: []params.StringsWatchResult{{StringsWatcherId: "1"}},
Expand Down

0 comments on commit 326f79b

Please sign in to comment.