Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,8 @@
}
Assert.NotNull(response.Content.Headers.GetValues(HeaderNames.ContentMD5));
Assert.Empty(response.Content.Headers.ContentEncoding);
Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength);
// Check that compressed size is within a reasonable range
Assert.InRange(response.Content.Headers.ContentLength, (int)(expectedBodyLength! - 5), (int)(expectedBodyLength! + 5));

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.

Check failure on line 1328 in src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs#L1328

src/Middleware/ResponseCompression/test/ResponseCompressionMiddlewareTest.cs(1328,16): error CS0313: (NETCORE_ENGINEERING_TELEMETRY=Build) The type 'long?' cannot be used as type parameter 'T' in the generic type or method 'Assert.InRange<T>(T, T, T)'. The nullable type 'long?' does not satisfy the constraint of 'System.IComparable'. Nullable types can not satisfy any interface constraints.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assert.InRange(response.Content.Headers.ContentLength, (int)(expectedBodyLength! - 5), (int)(expectedBodyLength! + 5));
Assert.InRange(response.Content.Headers.ContentLength, (int)(expectedBodyLength.Value - 5), (int)(expectedBodyLength.Value + 5));

}

private static void AssertLog(WriteContext log, LogLevel level, string message)
Expand Down
Loading