mongo: testEnsureNumaCtl fails when $TMPDIR is set

Bug #1492000 reported by Roger Peppe
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Won't Fix
Medium
@les

Bug Description

This assertion can fail because the temp dir does not necessarily
match the asserted pattern.

Also, FWIW, there is no point in having the '($MULTI_NODE)' pattern
there - it can never match (because the $ is not escaped) and
the ?.* after it means that it is irrelevant whether it matches or not.

Example failure.

 ----------------------------------------------------------------------
 FAIL: mongo_test.go:202: MongoSuite.TestEnsureServer

 [LOG] 0:00.000 INFO juju.mongo Ensuring mongo server is running; data directory /tmp/alesstimec/check-4990765271833742716/15; port 25252
 [LOG] 0:00.000 INFO juju.mongo installing juju-mongodb
 [LOG] 0:00.000 INFO juju.utils.packaging.manager Running: apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet install juju-mongodb
 [LOG] 0:00.095 DEBUG juju.mongo using mongod: /tmp/alesstimec/check-4990765271833742716/13/mongod --version: "db version v2.4.9"
 mongo_test.go:203:
     dataDir := s.testEnsureServerNumaCtl(c, false)
 mongo_test.go:315:
     c.Assert(service.Conf().ExecStart, gc.Matches, `($MULTI_NODE)?.*tmp/check-.*/mongod.*`)
 ... value string = "/tmp/alesstimec/check-4990765271833742716/13/mongod --auth --dbpath '/tmp/alesstimec/check-4990765271833742716/15/db' --sslOnNormalPorts --sslPEMKeyFile '/tmp/alesstimec/check-4990765271833742716/15/server.pem' --sslPEMKeyPassword ignored --port 25252 --noprealloc --syslog --smallfiles --journal --keyFile '/tmp/alesstimec/check-4990765271833742716/15/shared-secret' --replSet juju --ipv6 --oplogSize 1"
 ... regex string = "($MULTI_NODE)?.*tmp/check-.*/mongod.*"

 ----------------------------------------------------------------------
 FAIL: mongo_test.go:283: MongoSuite.TestEnsureServerNumaCtl

 [LOG] 0:00.000 INFO juju.mongo Ensuring mongo server is running; data directory /tmp/alesstimec/check-4990765271833742716/19; port 25252
 [LOG] 0:00.000 INFO juju.mongo installing juju-mongodb and numactl
 [LOG] 0:00.000 INFO juju.utils.packaging.manager Running: apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet install juju-mongodb
 [LOG] 0:00.050 INFO juju.utils.packaging.manager Running: apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-yes --quiet install numactl
 [LOG] 0:00.093 DEBUG juju.mongo using mongod: /tmp/alesstimec/check-4990765271833742716/17/mongod --version: "db version v2.4.9"
 mongo_test.go:284:
     s.testEnsureServerNumaCtl(c, true)
 mongo_test.go:315:
     c.Assert(service.Conf().ExecStart, gc.Matches, `($MULTI_NODE)?.*tmp/check-.*/mongod.*`)
 ... value string = "$MULTI_NODE/tmp/alesstimec/check-4990765271833742716/17/mongod --auth --dbpath '/tmp/alesstimec/check-4990765271833742716/19/db' --sslOnNormalPorts --sslPEMKeyFile '/tmp/alesstimec/check-4990765271833742716/19/server.pem' --sslPEMKeyPassword ignored --port 25252 --noprealloc --syslog --smallfiles --journal --keyFile '/tmp/alesstimec/check-4990765271833742716/19/shared-secret' --replSet juju --ipv6 --oplogSize 1"
 ... regex string = "($MULTI_NODE)?.*tmp/check-.*/mongod.*"

 OOPS: 49 passed, 2 FAILED
 --- FAIL: Test (10.66s)
 FAIL
 FAIL github.com/juju/juju/mongo 10.797s

Tags: unit-tests
Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
tags: added: unit-tests
@les (alesstimec)
Changed in juju-core:
assignee: nobody → @les (alesstimec)
status: Triaged → In Progress
Changed in juju-core:
status: In Progress → Won't Fix
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.