gcash/bchwallet

Tests failing on travis

cpacia opened this issue · 3 comments

There are a couple tests that seem to sometimes fail and sometimes pass on travis. The error is always Failed to create Manager: failed to master public key: unable to decrypt. Since travis runs the tests for different versions of Go it's almost a guarantee that one of them will fail and need to be restarted.

I can't get this to replicate on my home machine. Tests pass 100% of the time for me. So I'm finding it difficult to debug.

Some more info: There is a variable called:

secretKeyGen = defaultNewSecretKey

which is normally set to the default key generator function. However one of the tests replaces it with a new function that intentionally fails in order to test the failure case. However, every time travis fails it's because this other function fired and caused the failure.

So it sounds like race condition with this variable being set incorrectly. However, the variable is protected by a mutex. So I don't see how it could be set incorrectly.

Go runs these in parallel and the mutex doesn't help because the global var in the package has been replaced. I can look into a better way to do this.

This was resolved.