Skip to content

Commit 7af0b82

Browse files
committed
Misc items
* Only setup / dispose ToxiproxyManager when those tests are enabled.
1 parent a464d61 commit 7af0b82

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

projects/Test/Integration/TestToxiproxy.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,25 @@ public override Task InitializeAsync()
6161
Assert.Null(_conn);
6262
Assert.Null(_channel);
6363

64-
_toxiproxyManager = new ToxiproxyManager(_testDisplayName, IsRunningInCI, IsWindows);
65-
_proxyPort = ToxiproxyManager.ProxyPort;
66-
return _toxiproxyManager.InitializeAsync();
64+
if (AreToxiproxyTestsEnabled)
65+
{
66+
_toxiproxyManager = new ToxiproxyManager(_testDisplayName, IsRunningInCI, IsWindows);
67+
_proxyPort = ToxiproxyManager.ProxyPort;
68+
return _toxiproxyManager.InitializeAsync();
69+
}
70+
else
71+
{
72+
return Task.CompletedTask;
73+
}
6774
}
6875

6976
public override async Task DisposeAsync()
7077
{
71-
await _toxiproxyManager.DisposeAsync();
78+
if (AreToxiproxyTestsEnabled)
79+
{
80+
await _toxiproxyManager.DisposeAsync();
81+
}
82+
7283
await base.DisposeAsync();
7384
}
7485

0 commit comments

Comments
 (0)