Increase error body max length before truncation (#3762)

This commit is contained in:
eric sciple
2025-03-20 20:09:00 -05:00
committed by GitHub
parent 6654f6b3de
commit dc9695f123
2 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
using GitHub.Actions.RunService.WebApi;
using Xunit;
namespace GitHub.Actions.RunService.WebApi.Tests;
public sealed class RunServiceHttpClientL0
{
[Fact]
public void Truncate()
{
TestTruncate(string.Empty.PadLeft(199, 'a'), string.Empty.PadLeft(199, 'a'));
TestTruncate(string.Empty.PadLeft(200, 'a'), string.Empty.PadLeft(200, 'a'));
TestTruncate(string.Empty.PadLeft(201, 'a'), string.Empty.PadLeft(200, 'a') + "[truncated]");
}
private void TestTruncate(string errorBody, string expected)
{
Assert.Equal(expected, RunServiceHttpClient.Truncate(errorBody));
}
}