This test is broken b design. You can't randomly select accounts and acquire locks on them without a timeout because this is the classical example of a deadlock.