Skip to content

Commit 24a075f

Browse files
committed
make more test use the GarnetApplication
1 parent c9f752a commit 24a075f

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

test/Garnet.test/RespSetTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ namespace Garnet.test
1717
[TestFixture]
1818
public class RespSetTest
1919
{
20-
GarnetServer server;
20+
GarnetApplication server;
2121

2222
[SetUp]
23-
public void Setup()
23+
public async Task Setup()
2424
{
2525
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
26-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, lowMemory: true);
27-
server.Start();
26+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, lowMemory: true);
27+
await server.RunAsync();
2828
}
2929

3030
[TearDown]
31-
public void TearDown()
31+
public async Task TearDown()
3232
{
33-
server.Dispose();
33+
await server.StopAsync();
3434
TestUtils.DeleteDirectory(TestUtils.MethodTestDir);
3535
}
3636

test/Garnet.test/RespTests.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ namespace Garnet.test
2020
[TestFixture]
2121
public class RespTests
2222
{
23-
GarnetServer server;
23+
GarnetApplication server;
2424
Random r;
2525

2626
[SetUp]
27-
public void Setup()
27+
public async Task Setup()
2828
{
2929
r = new Random(674386);
3030
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
31-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, disablePubSub: false);
32-
server.Start();
31+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, disablePubSub: false);
32+
await server.RunAsync();
3333
}
3434

3535
[TearDown]
36-
public void TearDown()
36+
public async Task TearDown()
3737
{
38-
server.Dispose();
38+
await server.StopAsync();
3939
TestUtils.DeleteDirectory(TestUtils.MethodTestDir);
4040
}
4141

@@ -1359,13 +1359,13 @@ public void SingleDelete()
13591359
}
13601360

13611361
[Test]
1362-
public void SingleDeleteWithObjectStoreDisabled()
1362+
public async Task SingleDeleteWithObjectStoreDisabled()
13631363
{
13641364
TearDown();
13651365

13661366
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1367-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, DisableObjects: true);
1368-
server.Start();
1367+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, DisableObjects: true);
1368+
await server.RunAsync();
13691369

13701370
var key = "delKey";
13711371
var value = "1234";
@@ -1391,13 +1391,13 @@ private string GetRandomString(int len)
13911391
}
13921392

13931393
[Test]
1394-
public void SingleDeleteWithObjectStoreDisable_LTM()
1394+
public async Task SingleDeleteWithObjectStoreDisable_LTM()
13951395
{
13961396
TearDown();
13971397

13981398
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1399-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, lowMemory: true, DisableObjects: true);
1400-
server.Start();
1399+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, lowMemory: true, DisableObjects: true);
1400+
await server.RunAsync();
14011401
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
14021402
var db = redis.GetDatabase(0);
14031403

@@ -1431,14 +1431,14 @@ public void SingleDeleteWithObjectStoreDisable_LTM()
14311431
}
14321432

14331433
[Test]
1434-
public void MultiKeyDelete([Values] bool withoutObjectStore)
1434+
public async Task MultiKeyDelete([Values] bool withoutObjectStore)
14351435
{
14361436
if (withoutObjectStore)
14371437
{
14381438
TearDown();
14391439
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1440-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, DisableObjects: true);
1441-
server.Start();
1440+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, DisableObjects: true);
1441+
await server.RunAsync();
14421442
}
14431443

14441444
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
@@ -1499,14 +1499,14 @@ public void MultiKeyDeleteObjectStore()
14991499
}
15001500

15011501
[Test]
1502-
public void MultiKeyUnlink([Values] bool withoutObjectStore)
1502+
public async Task MultiKeyUnlink([Values] bool withoutObjectStore)
15031503
{
15041504
if (withoutObjectStore)
15051505
{
15061506
TearDown();
15071507
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1508-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, DisableObjects: true);
1509-
server.Start();
1508+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, DisableObjects: true);
1509+
await server.RunAsync();
15101510
}
15111511

15121512
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
@@ -1565,14 +1565,14 @@ public void MultiKeyUnlinkObjectStore()
15651565
}
15661566

15671567
[Test]
1568-
public void SingleExists([Values] bool withoutObjectStore)
1568+
public async Task SingleExists([Values] bool withoutObjectStore)
15691569
{
15701570
if (withoutObjectStore)
15711571
{
15721572
TearDown();
15731573
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1574-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, DisableObjects: true);
1575-
server.Start();
1574+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, DisableObjects: true);
1575+
await server.RunAsync();
15761576
}
15771577
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
15781578
var db = redis.GetDatabase(0);
@@ -1830,14 +1830,14 @@ public void SingleRenameWithExpiry()
18301830
}
18311831

18321832
[Test]
1833-
public void SingleRenameKeyEdgeCase([Values] bool withoutObjectStore)
1833+
public async Task SingleRenameKeyEdgeCase([Values] bool withoutObjectStore)
18341834
{
18351835
if (withoutObjectStore)
18361836
{
18371837
TearDown();
18381838
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
1839-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, DisableObjects: true);
1840-
server.Start();
1839+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, DisableObjects: true);
1840+
await server.RunAsync();
18411841
}
18421842
using var redis = ConnectionMultiplexer.Connect(TestUtils.GetConfig());
18431843
var db = redis.GetDatabase(0);
@@ -3730,13 +3730,13 @@ public void HelloTest1()
37303730
}
37313731

37323732
[Test]
3733-
public void AsyncTest1()
3733+
public async Task AsyncTest1()
37343734
{
37353735
// Set up low-memory database
37363736
TearDown();
37373737
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
3738-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, lowMemory: true, DisableObjects: true);
3739-
server.Start();
3738+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, lowMemory: true, DisableObjects: true);
3739+
await server.RunAsync();
37403740

37413741
string firstKey = null, firstValue = null, lastKey = null, lastValue = null;
37423742

test/Garnet.test/RespTlsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ namespace Garnet.test
1717
[TestFixture]
1818
public class RespTlsTests
1919
{
20-
GarnetServer server;
20+
GarnetApplication server;
2121

2222
[SetUp]
23-
public void Setup()
23+
public async Task Setup()
2424
{
2525
TestUtils.DeleteDirectory(TestUtils.MethodTestDir, wait: true);
26-
server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir, EnableTLS: true);
27-
server.Start();
26+
server = TestUtils.CreateGarnetApplication(TestUtils.MethodTestDir, EnableTLS: true);
27+
await server.RunAsync();
2828
}
2929

3030
[TearDown]
31-
public void TearDown()
31+
public async Task TearDown()
3232
{
33-
server.Dispose();
33+
await server.StopAsync();
3434
TestUtils.DeleteDirectory(TestUtils.MethodTestDir);
3535
}
3636

0 commit comments

Comments
 (0)