Skip to content

SQL Server 7,000-row bulk-copy test times out intermittently on CI since the parallel limiter was removed #479

Closed

Description

@thomhurst

Summary

Dapper_business_commands_and_outbox_rows_commit_atomically_in_one_batch in tests/Relayer.Outbox.SqlServer.Tests/AdoNetEnlistmentTests.cs timed out on CI in both its sync and async cases. Each commits 7,000 outbox rows through SqlBulkCopy, and the copy hit SqlClient's default 30-second bulk-copy timeout. It is intermittent: the three other CI runs I saw that included the same main passed.

This started after #472 removed the suite's ParallelLimiter of 4, whose comment said it protected exactly this timeout under CI contention. AGENTS.md does not allow putting the limiter back, so the test needs a fix of its own.

Observed

CI run https://github.com/thomhurst/Relayer/actions/runs/42810268778/job/129809676736 (PR #475, which does not touch SQL Server):

failed Dapper_business_commands_and_outbox_rows_commit_atomically_in_one_batch(True) (31s 593ms)
  SqlException: Execution Timeout Expired. ... Operation cancelled by user. The statement has been terminated.
    at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServer(DbDataReader reader)
    at Relayer.Outbox.SqlServer.SqlServerOutboxBatch.Execute() SqlServerOutboxBatch.cs:61
    at Relayer.Outbox.SqlServer.SqlServerOutboxTransaction.Commit() SqlServerOutboxTransaction.cs:65

The (False) case failed the same way. Locally (macOS ARM64, Docker Desktop) the whole project passed three times without the limiter, in 21-23s.

What to find out

  • Why a 7,000-row copy takes over 30s on the runner. Whole-machine starvation (every test project runs at once on 4 vCPUs) and something blocking inside SQL Server look different in the server's wait stats; capture them on a failing run.
  • Whether 7,000 rows means something specific. Add SQL Server ADO.NET outbox transaction enlistment #324 only says "7000-row batches". If the test only needs "many rows in one batch", a smaller count proves the same thing.
  • SqlServerOutboxBatch creates its SqlBulkCopy without setting BulkCopyTimeout, so applications get the 30s default whatever command timeout they configured. Decide whether that should follow the caller's configuration; if it should, the test can then set its own budget.

Expected

The test passes reliably on CI without a suite-wide concurrency limit.

Activity

  1. added
    bug
    area: testing
    area: outbox
    P1
    on Nov 10, 2026
  2. thomhurst commented on Nov 10, 2026

    @thomhurst
    OwnerAuthor

    Red-main follow-up: main run 42822068563 fails only both 7,000-row SQL Server atomic-batch cases at SqlBulkCopy timeout. Fresh origin/main still uses 7,000 rows. #482 remains the focused fix with Closes #479; #485 investigates production bulk-copy performance and does not replace this test fix.

    The earlier wait ended: 42822850989 completed with the SQL Server tests passing, but Pub/Sub Reconnect failed with ResponseEnded during reconnect and shutdown. #482 is now draft. Released main-ci and attempted the blocker-first route, but acquire pr-482 returned HELD/exit 3: another worker owns the fix and its CI recovery. No competing implementation or rerun was started.

    Already-implemented and supersession routes do not apply: the test fix is absent from main, #479 remains open with its original acceptance criterion, and #482 delivers it. This is a recurring test failure, not demonstrated infrastructure eligible for a main rerun; dispatching main before the fix merges would not resolve it. No parent closure, stale-scope rewrite, human decision, or upstream release gate applies. Current blocker is [locked] #482, not waiting for the completed run. No on-hold label added. All owned locks released at unit completion.

  3. added 2 commits that reference this issue on Nov 10, 2026
    0130137
    35fa17d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1area: outboxarea: testingbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions