Skip to content

Commit

Permalink
Semaphore release w/o acquire moves the count up
Browse files Browse the repository at this point in the history
  • Loading branch information
kovyrin committed Oct 16, 2024
1 parent b9cff3b commit 2ce9c79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ def test_release_semaphore_without_acquire

assert_equal(1, resource.count)

# Should do nothing and not raise an error
# Should not raise an error
resource.release_semaphore

assert_equal(1, resource.count)
# It has now screwed up the semaphore count because we didn't acquire before releasing
assert_equal(2, resource.count)
end

def test_acquire_timeout_override
Expand Down

0 comments on commit 2ce9c79

Please sign in to comment.