Code review comment for lp:~jtv/juju-core/generic-locking-test

Revision history for this message
Tim Penhey (thumper) wrote :

LGTM for what it is, but might be nice to have as a checker.

https://codereview.appspot.com/10433043/diff/1/environs/azure/environ_test.go
File environs/azure/environ_test.go (right):

https://codereview.appspot.com/10433043/diff/1/environs/azure/environ_test.go#newcode39
environs/azure/environ_test.go:39: func testLockingFunction(lock
*sync.Mutex, function func()) {
If this is to be a generic testing function, you should move it to the
testing package and export it.

Here is a thought. Want to write this as a checker?

c.Assert(some_func, ObservesLockOn(some_mutex)) ?

https://codereview.appspot.com/10433043/diff/1/environs/azure/environ_test.go#newcode60
environs/azure/environ_test.go:60: // misbehaved "function" plenty of
rope to hang itself.
You could have a few sleep(0) type calls, as this should do the same
thing.

https://codereview.appspot.com/10433043/diff/1/environs/azure/environ_test.go#newcode74
environs/azure/environ_test.go:74: blankLock := sync.Mutex{}
Wow, surprised there is not a way to ask if a mutex is locked.

https://codereview.appspot.com/10433043/

« Back to merge proposal