Write test which simulate the deadlocks the were observed when there is lock contention between gc and sync or other long running queries.