test: switched to async/await for lock tests
This commit is contained in:
parent
315dc89b36
commit
8944ae37ab
|
@ -24,9 +24,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ReadBlocksWrite()
|
||||
public async Task ReadBlocksWrite()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestRead(1, 5, 1)),
|
||||
Task.Run(() => this.TestWrite(2, 2, 2))
|
||||
);
|
||||
|
@ -42,9 +42,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ReadsDoNotBlockReads()
|
||||
public async Task ReadsDoNotBlockReads()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestRead(1, 8, 1)),
|
||||
Task.Run(() => this.TestRead(2, 1, 2)),
|
||||
Task.Run(() => this.TestRead(4, 1, 3))
|
||||
|
@ -64,9 +64,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void UpgradableBlocksUpgradable()
|
||||
public async Task UpgradableBlocksUpgradable()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestUpgradable(1, 10, 1)),
|
||||
Task.Run(() => this.TestUpgradable(2, 2, 2)),
|
||||
Task.Run(() => this.TestUpgradable(5, 1, 3))
|
||||
|
@ -86,9 +86,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void UpgradableDoesNotBlockReads()
|
||||
public async Task UpgradableDoesNotBlockReads()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestUpgradable(1, 6, 1)),
|
||||
Task.Run(() => this.TestRead(2, 1, 2)),
|
||||
Task.Run(() => this.TestRead(4, 1, 3))
|
||||
|
@ -108,9 +108,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void WriteBlockRead()
|
||||
public async Task WriteBlockRead()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestWrite(1, 6, 1)),
|
||||
Task.Run(() => this.TestRead(2, 1, 2))
|
||||
);
|
||||
|
@ -126,9 +126,9 @@ public class LockTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void WriteBlockReads()
|
||||
public async Task WriteBlockReads()
|
||||
{
|
||||
Task.WaitAll(
|
||||
await Task.WhenAll(
|
||||
Task.Run(() => this.TestWrite(1, 6, 1)),
|
||||
Task.Run(() => this.TestRead(2, 1, 2))
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue