Samuel, see the trace above in comment #2; it shows exactly where the lock occurred. However, it being a race-hazard bug means that it'll be hard to re-produce especially if you have a fast desktop/laptop as that'll make the locks smaller and thus less likely to occur at the same time.
One way to force a lock is just to do write a tight loop for say, 10 seconds, that constantly writes to the sql db (using the kv store) in at least two tests, limit the concurrency to 2 threads and that'll almost certainly result in a failure. However, it's probably not necessary to do that.
Either just use Cory's solution (#3) or better, make sure it is mocked out, as we are not actually testing the SQL database, and it's locking behaviour may change over versions. Thanks!
Samuel, see the trace above in comment #2; it shows exactly where the lock occurred. However, it being a race-hazard bug means that it'll be hard to re-produce especially if you have a fast desktop/laptop as that'll make the locks smaller and thus less likely to occur at the same time.
One way to force a lock is just to do write a tight loop for say, 10 seconds, that constantly writes to the sql db (using the kv store) in at least two tests, limit the concurrency to 2 threads and that'll almost certainly result in a failure. However, it's probably not necessary to do that.
Either just use Cory's solution (#3) or better, make sure it is mocked out, as we are not actually testing the SQL database, and it's locking behaviour may change over versions. Thanks!