Skip to content

Commit 149fd3a

Browse files
committed
test: fix integration tests
1 parent 7b15337 commit 149fd3a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/Prometheus.Client.MetricServer.Tests/MetricServerTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Prometheus.Client.MetricServer.Tests
1111
public class MetricServerTests
1212
{
1313
private readonly ITestOutputHelper _testOutputHelper;
14-
private const int _port = 5055;
14+
private const int _port = 9091;
1515

1616
public MetricServerTests(ITestOutputHelper testOutputHelper)
1717
{
@@ -31,7 +31,7 @@ public void Start_Stop_IsRunning()
3131
[Fact]
3232
public async Task Base_MapPath()
3333
{
34-
var metricServer = new MetricServer(new CollectorRegistry(), new MetricServerOptions { Port = _port });
34+
var metricServer = new MetricServer(new MetricServerOptions { Port = _port});
3535
try
3636
{
3737
metricServer.Start();
@@ -55,9 +55,7 @@ public async Task Base_MapPath()
5555
[Fact]
5656
public async Task MapPath_WithEndSlash()
5757
{
58-
var metricServer = new MetricServer(
59-
new CollectorRegistry(),
60-
new MetricServerOptions { Port = _port, MapPath = "/test" });
58+
var metricServer = new MetricServer(new MetricServerOptions { Port = _port, MapPath = "/test" });
6159
try
6260
{
6361
metricServer.Start();
@@ -92,9 +90,7 @@ public void Wrong_MapPath()
9290
[InlineData("/metrics965")]
9391
public async Task MapPath(string mapPath)
9492
{
95-
var metricServer = new MetricServer(
96-
new CollectorRegistry(),
97-
new MetricServerOptions { Port = _port, MapPath = mapPath });
93+
var metricServer = new MetricServer(new MetricServerOptions { Port = _port, MapPath = mapPath });
9894
try
9995
{
10096
metricServer.Start();
@@ -119,7 +115,7 @@ public async Task MapPath(string mapPath)
119115
public async Task FindMetric()
120116
{
121117
var registry = new CollectorRegistry();
122-
var factory = new MetricFactory(new CollectorRegistry());
118+
var factory = new MetricFactory(registry);
123119
var metricServer = new MetricServer(registry, new MetricServerOptions { Port = _port });
124120

125121
try

0 commit comments

Comments
 (0)