proper test locking