test(sql): correct the cancelled-token test's overclaim
Its doc said it pinned "the real provider's cancellation path", but the token is cancelled before ReadAsync so the OCE is raised at the reader's SemaphoreSlim.WaitAsync gate, before any SqlConnection opens — it never exercises Microsoft.Data.SqlClient's in-flight command cancellation. Softened (option (a)) to state accurately what it proves: an already- cancelled token propagates as OCE and is never swallowed into a Bad snapshot or an unreachable-database verdict. The in-flight/deadline path is covered by SqlBlackholeTimeoutTests. Claude-Session: https://claude.ai/code/session_01GASWkNEi68FSCtvr6rLoEW
This commit is contained in:
@@ -322,8 +322,16 @@ public sealed class SqlServerReadTests
|
||||
/// <summary>
|
||||
/// A cancelled poll propagates <see cref="OperationCanceledException"/> rather than publishing
|
||||
/// Bad-quality snapshots: the engine asked the poll to stop and nobody is waiting for values. The
|
||||
/// asymmetry with a deadline breach (which DOES publish BadTimeout) is deliberate, so it is pinned
|
||||
/// here against the real provider's cancellation path.
|
||||
/// asymmetry with a deadline breach (which DOES publish BadTimeout) is deliberate.
|
||||
/// <para><b>What this proves, precisely.</b> The token is <em>already</em> cancelled before
|
||||
/// <c>ReadAsync</c> is called, so the cancellation is observed at the reader's first checkpoint —
|
||||
/// <c>SemaphoreSlim.WaitAsync(_, token)</c> — <b>before any <c>SqlConnection</c> opens</b>. It
|
||||
/// therefore does <b>not</b> exercise <c>Microsoft.Data.SqlClient</c>'s in-flight cancellation of a
|
||||
/// running command; that is left to the blackhole gate's deadline path
|
||||
/// (<c>SqlBlackholeTimeoutTests</c>). What it pins is the driver-shell contract that a cancelled
|
||||
/// token surfaces as an <see cref="OperationCanceledException"/> and is <b>never</b> swallowed into
|
||||
/// a Bad snapshot or misread as an unreachable-database verdict — an offline-equivalent guarantee,
|
||||
/// run here over the real provider only to keep it beside its siblings.</para>
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task ReadAsync_realSqlServer_cancelledTokenPropagatesRatherThanBadCoding()
|
||||
|
||||
Reference in New Issue
Block a user