Skip to content

Commit bb3ffe0

Browse files
Copilotdevstress
andcommitted
Fix observability test CreateHttpClient endpoint resolution
Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
1 parent c8c8660 commit bb3ffe0

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

LocalTesting/LocalTesting.IntegrationTests/StepDefinitions/ObservabilityMetricsSteps.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ private async Task EnsureInfrastructureInitialized()
4848
_app = await builder.BuildAsync();
4949
await _app.StartAsync();
5050

51-
// Create HTTP client with service discovery
52-
_httpClient = _app.CreateHttpClient("localtesting-webapi");
51+
// Create HTTP client with service discovery - use the correct endpoint name "webapi"
52+
_httpClient = _app.CreateHttpClient("localtesting-webapi", "webapi");
5353
_httpClient.Timeout = TimeSpan.FromMinutes(15); // Extended timeout for 1M messages
5454

5555
lock (_lockObject)

test-observability-fix.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Test script for observability tests fix - requires .NET 9.0 environment
4+
echo "🔧 Testing Observability Tests Fix"
5+
echo "📋 Fixed: CreateHttpClient endpoint name issue"
6+
echo ""
7+
8+
# Check .NET version
9+
echo "1. Checking .NET version..."
10+
dotnet --version
11+
12+
if [ $? -ne 0 ]; then
13+
echo "❌ .NET 9.0 SDK not found. Please install .NET 9.0.100 or later."
14+
echo "📥 Download from: https://dotnet.microsoft.com/download/dotnet/9.0"
15+
exit 1
16+
fi
17+
18+
echo ""
19+
echo "2. Building LocalTesting solution..."
20+
dotnet build LocalTesting/LocalTesting.sln --configuration Release
21+
22+
if [ $? -ne 0 ]; then
23+
echo "❌ Build failed. Cannot proceed with observability tests."
24+
exit 1
25+
fi
26+
27+
echo ""
28+
echo "3. Running observability tests..."
29+
dotnet test LocalTesting/LocalTesting.IntegrationTests --filter "Category=observability" --configuration Release
30+
31+
echo ""
32+
echo "✅ Observability test execution completed"
33+
echo "🔧 Fix applied: Corrected CreateHttpClient endpoint name from 'localtesting-webapi' to ('localtesting-webapi', 'webapi')"
34+
echo "📝 The Aspire testing framework now properly resolves the HTTP endpoint"

0 commit comments

Comments
 (0)