tests such as org.apache.zookeeper.test.MultiTransactionTest.testWatchesTriggered() are incorrect. Two issues I see
1) zk.sync is async, there is no guarantee that the watcher will be called subsequent to sync returning
The callback needs to be implemented, only once the callback is called can we verify the trigger.
2) trigger is not declared as volatile, even though it will be set in the context of a different thread (eventthread)
for an example of a false positive failure