Index: cmd/jujud/agent_test.go |
=== modified file 'cmd/jujud/agent_test.go' |
--- cmd/jujud/agent_test.go 2013-08-24 13:50:05 +0000 |
+++ cmd/jujud/agent_test.go 2013-09-10 23:29:08 +0000 |
@@ -20,6 +20,7 @@ |
envtools "launchpad.net/juju-core/environs/tools" |
"launchpad.net/juju-core/juju/testing" |
"launchpad.net/juju-core/state" |
+ "launchpad.net/juju-core/state/api" |
coretesting "launchpad.net/juju-core/testing" |
coretools "launchpad.net/juju-core/tools" |
"launchpad.net/juju-core/version" |
@@ -107,19 +108,25 @@ |
// agentSuite is a fixture to be used by agent test suites. |
type agentSuite struct { |
- oldRestartDelay time.Duration |
testing.JujuConnSuite |
+ oldRestartDelay time.Duration |
+ oldConnectionOptions api.DialOpts |
} |
func (s *agentSuite) SetUpSuite(c *gc.C) { |
+ s.JujuConnSuite.SetUpSuite(c) |
s.oldRestartDelay = worker.RestartDelay |
+ s.oldConnectionOptions = apiConnectionOptions |
+ apiConnectionOptions = api.DialOpts{ |
+ Timeout: 50 * time.Millisecond, |
+ } |
worker.RestartDelay = coretesting.ShortWait |
- s.JujuConnSuite.SetUpSuite(c) |
} |
func (s *agentSuite) TearDownSuite(c *gc.C) { |
+ worker.RestartDelay = s.oldRestartDelay |
+ apiConnectionOptions = s.oldConnectionOptions |
s.JujuConnSuite.TearDownSuite(c) |
- worker.RestartDelay = s.oldRestartDelay |
} |
// primeAgent writes the configuration file and tools for an agent with the |