Skip to content

Commit 6f0f8eb

Browse files
committed
Toxiproxy manager change
* Use `Guid.NewGuid` to ensure unique name * No need to delete first as names should be unique
1 parent 103c39e commit 6f0f8eb

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

projects/Test/Integration/ToxiproxyManager.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ public ToxiproxyManager(string testDisplayName, bool isRunningInCI, bool isWindo
3434

3535
_proxyPort = Interlocked.Increment(ref s_proxyPort);
3636

37-
/*
38-
string now = DateTime.UtcNow.ToString("o", System.Globalization.CultureInfo.InvariantCulture);
39-
Console.WriteLine("{0} [DEBUG] {1} _proxyPort {2}", now, testDisplayName, _proxyPort);
40-
*/
41-
4237
_proxyConnection = new Connection(resetAllToxicsAndProxiesOnClose: true);
4338
_proxyClient = _proxyConnection.Client();
4439

@@ -70,17 +65,9 @@ public ToxiproxyManager(string testDisplayName, bool isRunningInCI, bool isWindo
7065

7166
public async Task InitializeAsync()
7267
{
73-
string proxyName = $"{ProxyNamePrefix}-{_testDisplayName}-{Util.Now}-{Util.GenerateShortUuid()}";
68+
string proxyName = $"{ProxyNamePrefix}-{_testDisplayName}-{Util.Now}-{Guid.NewGuid()}";
7469
_proxy.Name = proxyName;
7570

76-
try
77-
{
78-
await _proxyClient.DeleteAsync(_proxy);
79-
}
80-
catch
81-
{
82-
}
83-
8471
ushort retryCount = 5;
8572
do
8673
{

0 commit comments

Comments
 (0)