I think it's the same problem as here.
When performing many operations in a short period of time, it's still neccessary to give testRPC a break here and there. Of course it can also be the case, that your testing code leads to racing conditions, which might not neccessarily be obvious or syntactical errors. It's hard to tell without the code, of course, but as long it runs on a testnet, you shouldn't have to worry that much. Of course, again, it depends also on the way your contracts are designed, for example, as one cannot guarantee that this specific scenario won't ever pop up under real conditions on the mainnet without knowing the details.
As of Solidity 0.4.9,
bad opcode is used for internal throws, like array out of bounds. So in your case, i'm pretty sure there is some condition in your testcode that makes the testes sometimes "try to do things", which are not intended to yet. Might be something is not properly promise-chained but sometimes being there just in time anyway.
Good Luck !