Skip to content

Commit

Permalink
Merge pull request juju#16012 from SimonRichardson/fix-intermittent-t…
Browse files Browse the repository at this point in the history
…est-failure

juju#16012

The following just ensures that we're not testing dates against each other as they can be wrong based on a timing window. The regex just cares that something is there, not what is there.

## Checklist

- [x] Go unit tests, with comments saying what you're testing

## QA steps

```sh
$ go test -v ./mongo -check.v -check.f=MongoSuite
```
  • Loading branch information
jujubot authored Jul 27, 2023
2 parents 53807f4 + 746964f commit 092d567
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mongo/mongo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ func (s *MongoSuite) assertMongoConfigFile(c *gc.C, dataDir string, ipV6 bool) {
c.Assert(err, jc.ErrorIsNil)
part1 := fmt.Sprintf(`
# WARNING
# autogenerated by juju on %s
# autogenerated by juju on .*
# manual changes to this file are likely to be overwritten
auth = true
bind_ip_all = true
dbpath = %s/db`[1:], s.clock.Now().UTC().Format(time.RFC822), dataDir)
dbpath = %s/db`[1:], dataDir)
if ipV6 {
part1 += "\nipv6 = true"
}
Expand All @@ -161,7 +161,7 @@ tlsCertificateKeyFile = %s/server.pem
tlsCertificateKeyFilePassword=ignored
tlsMode = requireTLS`, dataDir, dataDir, dataDir)

c.Assert(string(contents), jc.DeepEquals, part1+part2)
c.Assert(string(contents), gc.Matches, part1+part2)
}

func (s *MongoSuite) TestEnsureServerInstalled(c *gc.C) {
Expand Down

0 comments on commit 092d567

Please sign in to comment.