Skip to content

Commit 0717a2e

Browse files
committed
Tests: shorten SetExpirationToPassed
1 parent 97d5969 commit 0717a2e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

StackExchange.Redis.Tests/Issues/SO25113323.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Threading;
3+
using System.Threading.Tasks;
34
using Xunit;
45
using Xunit.Abstractions;
56

@@ -10,7 +11,7 @@ public class SO25113323 : TestBase
1011
public SO25113323(ITestOutputHelper output) : base (output) { }
1112

1213
[Fact]
13-
public void SetExpirationToPassed()
14+
public async Task SetExpirationToPassed()
1415
{
1516
var key = Me();
1617
using (var conn = Create())
@@ -20,10 +21,10 @@ public void SetExpirationToPassed()
2021
cache.KeyDelete(key);
2122
cache.HashSet(key, "full", "test", When.NotExists, CommandFlags.PreferMaster);
2223

23-
Thread.Sleep(10 * 1000);
24+
await Task.Delay(2000).ForAwait();
2425

2526
// When
26-
var expiresOn = DateTime.UtcNow.AddSeconds(-10);
27+
var expiresOn = DateTime.UtcNow.AddSeconds(-2);
2728

2829
var firstResult = cache.KeyExpire(key, expiresOn, CommandFlags.PreferMaster);
2930
var secondResult = cache.KeyExpire(key, expiresOn, CommandFlags.PreferMaster);

0 commit comments

Comments
 (0)