Skip to content

Commit d5cfc3d

Browse files
committed
Add workflow timeouts and stop pre-existing tracing
Set timeout-minutes on CI steps to avoid long-running/hung jobs (10m for integration test, 5m for report generation). In the sample test, call Context.Tracing.StopAsync() before starting tracing to ensure any leftover tracing from previous runs doesn't interfere with the new trace run. Modified .github/workflows/motus-ci.yml and samples/Motus.Samples/Tests/TraceCaptureSampleTest.cs.
1 parent 29dc97a commit d5cfc3d

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/motus-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
run: dotnet build Motus.sln --configuration Release
109109

110110
- name: Test (integration - Chrome)
111+
timeout-minutes: 10
111112
run: >-
112113
dotnet test Motus.sln
113114
--configuration Release
@@ -126,6 +127,7 @@ jobs:
126127

127128
- name: Generate Motus reports
128129
if: always()
130+
timeout-minutes: 5
129131
run: >-
130132
dotnet run --project src/Motus.Cli/Motus.Cli.csproj --configuration Release --framework net10.0 --no-build --
131133
run samples/Motus.Samples/bin/Release/net8.0/Motus.Samples.dll

samples/Motus.Samples/Tests/TraceCaptureSampleTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ public async Task CaptureFullWorkflowTrace()
1616
AppContext.BaseDirectory, "..", "..", "..", ".."));
1717
var tracePath = Path.Combine(projectDir, "sample-trace.zip");
1818

19+
// Stop any pre-existing tracing (e.g. from failure-tracing) before starting fresh
20+
await Context.Tracing.StopAsync();
21+
1922
await Context.Tracing.StartAsync(new TracingStartOptions
2023
{
2124
Screenshots = true,

0 commit comments

Comments
 (0)