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 2e3d786
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions worker/firewaller/firewaller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,18 +1038,15 @@ func (s *InstanceModeSuite) TestRemoteRelationProviderRoleConsumingSide(c *gc.C)
c.Check(version, gc.Equals, 0)
c.Check(id, gc.Equals, "")
c.Check(request, gc.Equals, "WatchEgressAddressesForRelations")
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(rArgs.Args, gc.HasLen, 1)
c.Assert(rArgs.Args[0].Macaroons, gc.HasLen, 1)

apitesting.MacaroonEquals(c, rArgs.Args[0].Macaroons[0], mac)

c.Check(rArgs.Args[0].Token, gc.Equals, relToken)

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

0 comments on commit 2e3d786

Please sign in to comment.