Skip to content

Commit

Permalink
Merge pull request #133 from martincostello/test-fixes-for-3xx
Browse files Browse the repository at this point in the history
Test fixes for 3xx
  • Loading branch information
martincostello authored Oct 8, 2018
2 parents f478809 + 6b35519 commit 472e1a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/JustEat.StatsD.Tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public static async Task Can_Send_Metrics_To_StatsD()
publisher.Decrement(1, 0, "red", "green"); // 7
publisher.Decrement(4, 1, "red", "green"); // 3

// Allow enough time for metrics to be registered
await Task.Delay(TimeSpan.FromSeconds(1.0));

// Assert
var result = await SendCommandAsync("counters");
result.Value<int>(config.Prefix + ".apple").ShouldBe(1);
Expand Down Expand Up @@ -89,11 +92,10 @@ private static async Task<JObject> SendCommandAsync(string command)

int bytesRead;

using (var stream = client.GetStream())
{
await stream.WriteAsync(input);
bytesRead = await stream.ReadAsync(output);
}
var stream = client.GetStream();

await stream.WriteAsync(input);
bytesRead = await stream.ReadAsync(output);

output = output.AsSpan(0, bytesRead).ToArray();

Expand Down
3 changes: 2 additions & 1 deletion src/JustEat.StatsD.Tests/statsdconfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
graphiteHost: "",
port: 8125,
backends: []
backends: [],
flushInterval: 120000
}

0 comments on commit 472e1a0

Please sign in to comment.