Skip to content

Commit 1d6c1b0

Browse files
fix(tests): drop leading "/" on relative-URL fixture — platform-portable
`ProxyEndpoints_RecordingProjection_Relative_Url_And_Zero_Status_Encodes_As_Error` asserted `ServerUrl == null` on the "URL has no scheme" branch. The fixture URL `"/relative-only/no-scheme"` happens to satisfy `Uri.TryCreate(..., UriKind.Absolute, out var u)` on Linux because System.Uri treats leading "/" paths as POSIX file paths (resolves to a `file://` URI). On Windows the same call returns false, leaving `parsed` null — which is the branch the test wanted to drive. Drop the leading slash so the URL is non-absolute on every platform. The intent (verify the projection's null-parsed branch + encoded HttpPath + queue dedup behaviour) is preserved; the test now passes on linux-amd64 CI runners that fell over on commit 2347e7e. Comment in source documents the trap so future contributors don't re-add the leading slash.
1 parent 062452c commit 1d6c1b0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/Kuestenlogik.Bowire.Tests/BranchCoverageGapsTests.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,13 @@ public async Task ProxyEndpoints_RecordingProjection_Relative_Url_And_Zero_Statu
517517
Id = 9002,
518518
CapturedAt = DateTimeOffset.FromUnixTimeMilliseconds(1234567890),
519519
Method = "POST",
520-
Url = "/relative-only/no-scheme",
520+
// No leading slash + no scheme: forces Uri.TryCreate(...,
521+
// UriKind.Absolute) to return false on every OS. A leading
522+
// "/" on Linux gets resolved to a file:// URI (POSIX path
523+
// semantics in System.Uri) which makes the "parsed is null"
524+
// branch unreachable on linux-arm64 CI runners — the test
525+
// failed for exactly this on commit 2347e7e.
526+
Url = "relative-only/no-scheme",
521527
ResponseStatus = 0, // network error
522528
LatencyMs = 0,
523529
RequestHeaders = new[]
@@ -546,7 +552,7 @@ public async Task ProxyEndpoints_RecordingProjection_Relative_Url_And_Zero_Statu
546552

547553
// parsed is null -> ServerUrl stays null, httpPath = flow.Url
548554
Assert.Null(step.ServerUrl);
549-
Assert.Equal("/relative-only/no-scheme", step.HttpPath);
555+
Assert.Equal("relative-only/no-scheme", step.HttpPath);
550556
// parsed?.Host ?? "" -> Service ""
551557
Assert.Equal("", step.Service);
552558
// ResponseStatus == 0 -> "Error"

0 commit comments

Comments
 (0)