Skip to content

Commit 143891f

Browse files
committed
Update LockEntryFacts.cs
Remove the test, because it's already tested in the upper level, and needs to be checked at the dispatcher level.
1 parent 00be2b7 commit 143891f

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

tests/Hangfire.InMemory.Tests/Entities/LockEntryFacts.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -74,45 +74,6 @@ public void TryAcquire_DoesNotAcquire_AlreadyOwnedLock()
7474
Assert.False(cleanUp);
7575
}
7676

77-
[Fact]
78-
public void TryAcquire_CanAcquire_AnAlreadyReleasedLock_ByAnotherOwner()
79-
{
80-
var entry = CreateLock();
81-
var completed = new ManualResetEventSlim(initialState: false);
82-
var another = new object();
83-
var cleanUp = false;
84-
Exception exception = null;
85-
86-
entry.TryAcquire(another, TimeSpan.Zero, out _, out _);
87-
88-
ThreadPool.QueueUserWorkItem(delegate
89-
{
90-
try
91-
{
92-
var acquired = entry.TryAcquire(_owner, TimeSpan.FromSeconds(5), out _, out _);
93-
entry.Release(_owner, out cleanUp);
94-
95-
Assert.True(acquired, "Should be acquired");
96-
}
97-
catch (Exception ex)
98-
{
99-
exception = ex;
100-
}
101-
finally
102-
{
103-
completed.Set();
104-
}
105-
});
106-
107-
Thread.Sleep(100); // Ensure second TryAcquire call is made
108-
entry.Release(another, out var anotherCleanUp);
109-
110-
completed.Wait();
111-
112-
if (exception != null) Assert.False(true, exception.ToString());
113-
Assert.True((cleanUp || anotherCleanUp) && (cleanUp != anotherCleanUp), "Should be clean up strictly once");
114-
}
115-
11677
[Fact]
11778
public void TryAcquire_OnAFinalizedLock_RequiresRetry()
11879
{

0 commit comments

Comments
 (0)