Skip to content

Commit

Permalink
Minor change in integration tests
Browse files Browse the repository at this point in the history
This uses the current time and a short uuid when creating test queues and exchanges.

Copied from rabbitmq/rabbitmq-amqp-dotnet-client
  • Loading branch information
lukebakken committed Dec 9, 2024
1 parent e4e05a0 commit 352dec0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/Test/Common/IntegrationFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,12 @@ protected async Task WithTemporaryChannelAsync(Func<IChannel, Task> action)

protected string GenerateExchangeName()
{
return $"{_testDisplayName}-exchange-{Guid.NewGuid()}";
return $"{_testDisplayName}-exchange-{Util.Now}-{GenerateShortUuid()}";
}

protected string GenerateQueueName()
{
return $"{_testDisplayName}-queue-{Guid.NewGuid()}";
return $"{_testDisplayName}-queue-{Util.Now}-{GenerateShortUuid()}";
}

protected Task WithTemporaryNonExclusiveQueueAsync(Func<IChannel, string, Task> action)
Expand Down Expand Up @@ -664,5 +664,7 @@ protected void LogWarning(string text,
_output.WriteLine("::warning file={0},line={1}::{2} {3}",
Path.GetFileName(file), line, member, text);
}

private static string GenerateShortUuid() => S_Random.Next().ToString("x");
}
}

0 comments on commit 352dec0

Please sign in to comment.