~rogpeppe/juju-core/256-more-status

« back to all changes in this revision

Viewing changes to worker/provisioner/provisioner_test.go

state: add dialTimeout parameter to state.Open

Updates LP#1084867

Remove the package level dialTimeout and replace it with a parameter passed to state.Open and state.Initalise.

This is part 1 of 3 changes addressing jam's comments from https://codereview.appspot.com/7528047/#msg2. As jam suspected, we were not using the SetDialTimeout helper consistently, nor was it even available outside the state package. To resolve this the helper has been removed and replaced by an explicit value passed to state.Open and state.Initalise.

The next proposal will build on this to pass a retryDelay value as originally proposed in https://codereview.appspot.com/7528047. 

The last proposal will address the heavy duplication of calls to state.Open/Initalise as a cleanup before reapplying https://codereview.appspot.com/7528047.

R=fwereade, wallyworld
CC=
https://codereview.appspot.com/7782049

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
                                // Check we can connect to the state with
90
90
                                // the machine's entity name and password.
91
 
                                st, err := state.Open(o.Info)
 
91
                                st, err := state.Open(o.Info, state.DefaultDialTimeout)
92
92
                                c.Assert(err, IsNil)
93
93
                                st.Close()
94
94