Integration test for locking.