Skip to content

Commit 15bedb6

Browse files
Increase debugger serialize timeout
1 parent d5726e6 commit 15bedb6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tracer/test/Datadog.Trace.Tests/Debugger/SnapshotHelper.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
using System;
77
using System.IO;
8+
using Datadog.Trace.Configuration;
9+
using Datadog.Trace.Configuration.Telemetry;
810
using Datadog.Trace.Debugger;
911
using Datadog.Trace.Debugger.Expressions;
1012
using Datadog.Trace.Debugger.Snapshots;
@@ -14,6 +16,21 @@ namespace Datadog.Trace.Tests.Debugger;
1416

1517
internal static class SnapshotHelper
1618
{
19+
static SnapshotHelper()
20+
{
21+
// Configure the serializer with a high timeout for tests to prevent rare timeout failures on slow CI machines
22+
var testSettings = new DebuggerSettings(
23+
new NameValueConfigurationSource(new()
24+
{
25+
{
26+
ConfigurationKeys.Debugger.MaxTimeToSerialize, "1000"
27+
}
28+
}),
29+
NullConfigurationTelemetry.Instance);
30+
31+
DebuggerSnapshotSerializer.SetConfig(testSettings);
32+
}
33+
1734
internal static string GenerateSnapshot(object instance, bool prettify = true)
1835
{
1936
return GenerateSnapshot(null, new object[] { }, new object[] { instance }, prettify);

0 commit comments

Comments
 (0)