Skip to content

Commit

Permalink
test: Improve random topic naming for Kafka integration tests (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Nov 9, 2023
1 parent f644e0f commit 322a00e
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using NewRelic.Agent.ContainerIntegrationTests.ContainerFixtures;
using NewRelic.Agent.IntegrationTestHelpers;
Expand All @@ -19,7 +20,6 @@ public abstract class LinuxKafkaTest<T> : NewRelicIntegrationTest<T> where T : L

internal string _topicName;
private readonly T _fixture;
private readonly static Random _rnd = new();

protected LinuxKafkaTest(T fixture, ITestOutputHelper output) : base(fixture)
{
Expand Down Expand Up @@ -105,7 +105,7 @@ internal static string GenerateTopic()
var builder = new StringBuilder();
for (int i = 0; i < TopicNameLength; i++)
{
var shifter = Convert.ToInt32(Math.Floor(25 * _rnd.NextDouble()));
var shifter= RandomNumberGenerator.GetInt32(0, 26);
builder.Append(Convert.ToChar(shifter + 65));
}

Expand Down

0 comments on commit 322a00e

Please sign in to comment.