Skip to content

Commit

Permalink
Toxiproxy manager change
Browse files Browse the repository at this point in the history
* Use `Guid.NewGuid` to ensure unique name
* No need to delete first as names should be unique
  • Loading branch information
lukebakken committed Dec 11, 2024
1 parent 103c39e commit 6f0f8eb
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions projects/Test/Integration/ToxiproxyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public ToxiproxyManager(string testDisplayName, bool isRunningInCI, bool isWindo

_proxyPort = Interlocked.Increment(ref s_proxyPort);

/*
string now = DateTime.UtcNow.ToString("o", System.Globalization.CultureInfo.InvariantCulture);
Console.WriteLine("{0} [DEBUG] {1} _proxyPort {2}", now, testDisplayName, _proxyPort);
*/

_proxyConnection = new Connection(resetAllToxicsAndProxiesOnClose: true);
_proxyClient = _proxyConnection.Client();

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

public async Task InitializeAsync()
{
string proxyName = $"{ProxyNamePrefix}-{_testDisplayName}-{Util.Now}-{Util.GenerateShortUuid()}";
string proxyName = $"{ProxyNamePrefix}-{_testDisplayName}-{Util.Now}-{Guid.NewGuid()}";
_proxy.Name = proxyName;

try
{
await _proxyClient.DeleteAsync(_proxy);
}
catch
{
}

ushort retryCount = 5;
do
{
Expand Down

0 comments on commit 6f0f8eb

Please sign in to comment.