File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 711711 lock . lock do
712712 lock . exists? . should . be . true
713713 REDIS_HANDLE . exists? ( "test_lock0" ) . should . be . true
714- sleep 0.3 # hand onto the lock
714+ sleep 1.0 # hang onto the lock across other thread
715715 end
716716 end
717717
735735 lock . lock do
736736 lock . exists? . should . be . true
737737 REDIS_HANDLE . exists? ( "test_lock1" ) . should . be . true
738- sleep 0.3 # hang onto the lock > expiry
738+ sleep 1.0 # hang onto the lock > expiry
739739 end
740740
741741 # lock value should not be set since the lock was held for more than the expiry
749749
750750 lock . lock do
751751 REDIS_HANDLE . exists? ( "test_lock2" ) . should . be . true
752- sleep 0.3 # expired, key is deleted
752+ sleep 1.0 # expired, key is deleted
753753 REDIS_HANDLE . exists? ( "test_lock2" ) . should . be . false
754754 REDIS_HANDLE . set ( "test_lock2" , "foo" ) # this is no longer a lock key, name is a coincidence
755755 end
758758 end
759759
760760 it "should manually delete the key if finished before expiration" do
761- lock = Redis ::Lock . new ( :test_lock3 , :expiration => 1 .0)
761+ lock = Redis ::Lock . new ( :test_lock3 , :expiration => 10 .0)
762762
763763 lock . lock do
764764 REDIS_HANDLE . exists? ( "test_lock3" ) . should . be . true
You can’t perform that action at this time.
0 commit comments