JUJU_ENV not isolated well in unit tests

Bug #1194902 reported by David Britton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Jesse Meek

Bug Description

    JUJU_ENV="foobar" go test launchpad.net/juju-core/...

will yield dozens of errors. This was hard for me to debug as a first time runner of the unit tests. Errors are in the form of the following:

----------------------------------------------------------------------
FAIL: deployer_test.go:44: DeployerSuite.TestDeployRecallRemovePrincipals

[LOG] 47.55917 INFO juju environs/testing: uploading FAKE tools 1.11.1-raring-amd64
[LOG] 47.55923 INFO juju environs/testing: uploading FAKE tools 1.11.1-precise-amd64
[LOG] 47.55929 INFO juju environs: reading tools with major version 1
[LOG] 47.55931 DEBUG juju environs/tools: reading v1.* tools
[LOG] 47.55933 INFO juju environs: falling back to public bucket
[LOG] 47.55934 DEBUG juju environs/tools: reading v1.* tools
[LOG] 47.55939 DEBUG juju environs/tools: found 1.11.1-precise-amd64
[LOG] 47.55944 DEBUG juju environs/tools: found 1.11.1-raring-amd64
[LOG] 47.55946 INFO juju environs: filtering tools by series: precise
[LOG] 47.55949 INFO juju environs: filtering tools by version: 1.11.1
[LOG] 47.55952 INFO juju environs/dummy: would pick tools from 1.11.1-precise-amd64
[LOG] 47.58016 INFO juju state: opening state; mongo addresses: ["localhost:54701"]; entity ""
[LOG] 47.58200 INFO juju state: connection established
[LOG] 47.66114 INFO juju state: initializing environment
[LOG] 47.68856 INFO juju state/api: listening on "localhost:0"
[LOG] 47.70867 INFO juju state: opening state; mongo addresses: ["localhost:54701"]; entity ""
[LOG] 47.71084 INFO juju state: connection established
[LOG] 47.71128 INFO juju juju: authorization error while connecting to state server; retrying
[LOG] 47.71134 INFO juju state: opening state; mongo addresses: ["localhost:54701"]; entity ""
[LOG] 47.71430 INFO juju state: connection established
[LOG] 47.76079 INFO juju state/api: dialing "wss://127.0.0.1:49209/"
[LOG] 47.76477 INFO juju rpc: discarding action method reflect.Method{Name:"apiRootForEntity", PkgPath:"launchpad.net/j
t.commonType)(0x7e8ac0), Func:reflect.Value{typ:(*reflect.commonType)(0x7e8ac0), val:(unsafe.Pointer)(0x699ec2), flag:0
[LOG] 47.76487 INFO juju state/api: connection established
[LOG] 47.76501 DEBUG juju rpc/jsoncodec: <- {"RequestId":1,"Type":"Admin","Request":"Login","Params":{"AuthTag":"user-a
[LOG] 47.76540 INFO juju rpc: discarding obtainer method reflect.Method{Name:"AuthEnvironManager", PkgPath:"", Type:(*r
ct.Value{typ:(*reflect.commonType)(0x731a20), val:(unsafe.Pointer)(0x69d6da), flag:0x130}, Index:1}
[LOG] 47.76543 INFO juju rpc: discarding obtainer method reflect.Method{Name:"AuthMachineAgent", PkgPath:"", Type:(*ref
.Value{typ:(*reflect.commonType)(0x731a20), val:(unsafe.Pointer)(0x69d5fd), flag:0x130}, Index:2}
[LOG] 47.76546 INFO juju rpc: discarding obtainer method reflect.Method{Name:"AuthOwner", PkgPath:"", Type:(*reflect.co
typ:(*reflect.commonType)(0x78d348), val:(unsafe.Pointer)(0x69d644), flag:0x130}, Index:3}
[LOG] 47.76554 INFO juju rpc: discarding obtainer method reflect.Method{Name:"Kill", PkgPath:"", Type:(*reflect.commonT
*reflect.commonType)(0x70f0b8), val:(unsafe.Pointer)(0x69c9df), flag:0x130}, Index:7}
[LOG] 47.76558 INFO juju rpc: discarding action method reflect.Method{Name:"getMachine", PkgPath:"launchpad.net/juju-co
ect.commonType)(0x7e9450), Func:reflect.Value{typ:(*reflect.commonType)(0x7e9450), val:(unsafe.Pointer)(0x6e90f9), flag
[LOG] 47.76561 INFO juju rpc: discarding action method reflect.Method{Name:"setPassword", PkgPath:"launchpad.net/juju-c
ect.commonType)(0x7e94d8), Func:reflect.Value{typ:(*reflect.commonType)(0x7e94d8), val:(unsafe.Pointer)(0x6e9f5f), flag
[LOG] 47.76565 INFO juju rpc: discarding obtainer method reflect.Method{Name:"requireAgent", PkgPath:"launchpad.net/juj
commonType)(0x731a98), Func:reflect.Value{typ:(*reflect.commonType)(0x731a98), val:(unsafe.Pointer)(0x69ca0d), flag:0x1
[LOG] 47.76568 INFO juju rpc: discarding obtainer method reflect.Method{Name:"requireClient", PkgPath:"launchpad.net/ju
.commonType)(0x731a98), Func:reflect.Value{typ:(*reflect.commonType)(0x731a98), val:(unsafe.Pointer)(0x69ca7b), flag:0x
[LOG] 47.76570 DEBUG juju rpc/jsoncodec: -> {"RequestId":1,"Response":{}}
[LOG] 47.76751 DEBUG juju rpc/jsoncodec: <- {"RequestId":2,"Type":"State","Request":"Ping","Params":{}}
[LOG] 47.76762 DEBUG juju rpc/jsoncodec: -> {"RequestId":2,"Error":"permission denied","ErrorCode":"unauthorized access
[LOG] 47.80232 INFO juju writing charm to storage [838 bytes]
[LOG] 47.80242 INFO juju adding charm to state
[LOG] 47.83658 INFO juju worker/deployer: checking unit "wordpress/0"
[LOG] 47.83678 INFO juju worker/deployer: deploying unit "wordpress/0"
deployer_test.go:65:
    s.waitFor(c, isDeployed(ctx, u0.Name()))
deployer_test.go:224:
    c.Fatalf("timeout")
... Error: timeout

[LOG] 48.59055 WARNING juju installer: cannot restart syslog daemon: exec ["restart" "rsyslog"]: exit status 1 (restart
; type="method_call", sender=":1.1632" (uid=1000 pid=1614 comm="restart rsyslog ") interface="com.ubuntu.Upstart0_6.Job
requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
[LOG] 48.63426 INFO juju environs/dummy: reset environment
[LOG] 48.63460 DEBUG juju rpc/jsoncodec: <- error: read tcp 127.0.0.1:51712: use of closed network connection (closing
2013-06-26 14:37:51 WARNING juju simple.go:136 installer: cannot restart syslog daemon: exec ["restart" "rsyslog"]: exi
ge, 1 matched rules; type="method_call", sender=":1.1636" (uid=1000 pid=1777 comm="restart rsyslog ") interface="com.ub
ror name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
2013-06-26 14:37:51 WARNING juju simple.go:172 installer: cannot restart syslog daemon: exec ["restart" "rsyslog"]: exi
ge, 1 matched rules; type="method_call", sender=":1.1637" (uid=1000 pid=1792 comm="restart rsyslog ") interface="com.ub
ror name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
2013-06-26 14:37:51 WARNING juju simple.go:136 installer: cannot restart syslog daemon: exec ["restart" "rsyslog"]: exi
ge, 1 matched rules; type="method_call", sender=":1.1638" (uid=1000 pid=1793 comm="restart rsyslog ") interface="com.ub
ror name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
OOPS: 5 passed, 1 FAILED
--- FAIL: TestPackage (3.04 seconds)

Related branches

John A Meinel (jameinel)
Changed in juju-core:
importance: Undecided → High
status: New → Triaged
Curtis Hovey (sinzui)
tags: added: intermittent-failure test-failure
Tim Penhey (thumper)
Changed in juju-core:
assignee: nobody → Jesse Meek (waigani)
Go Bot (go-bot)
Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: none → 1.17.3
Curtis Hovey (sinzui)
Changed in juju-core:
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.