From 96e3c29ac9c298602e66c70ddeaf66fb9cc9410d Mon Sep 17 00:00:00 2001
From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com>
Date: Fri, 30 Oct 2026 12:27:09 -0400
Subject: [PATCH] Update the Dashboard copy of the blocking pair merge test to
keep both sources (#6931) (#6954)
---
.../Dashboard.Tests/BlockingPairRowMergeTests.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/deprecated/Dashboard.Tests/BlockingPairRowMergeTests.cs b/deprecated/Dashboard.Tests/BlockingPairRowMergeTests.cs
index b13882cdcb..3818079b53 100644
--- a/deprecated/Dashboard.Tests/BlockingPairRowMergeTests.cs
+++ b/deprecated/Dashboard.Tests/BlockingPairRowMergeTests.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using PerformanceMonitor.Analysis;
using Xunit;
@@ -7,7 +8,7 @@ namespace PerformanceMonitorDashboard.Tests;
///
/// Unit tests for BlockingPairRowMerge — merging always-on DMV-snapshot pair-rows into blocked-process-report
-/// rows: BPR preferred, DMV-only filled in (the AWS RDS / threshold-unset case), overlapping edges deduped.
+/// rows: BPR preferred, DMV-only filled in (the AWS RDS / threshold-unset case), overlapping edges kept from both sources.
/// No database.
///
public class BlockingPairRowMergeTests
@@ -49,12 +50,13 @@ public void EmptyPrimary_AddsAllSnapshots()
}
[Fact]
- public void OverlappingEdge_PrefersBprAndDropsDmv()
+ public void OverlappingEdge_KeepsBothSources()
{
- // Same edge (blocked/blocker spid:ecid, same minute) from both sources -> only the BPR row survives.
+ // Same edge (blocked/blocker spid:ecid, same minute) from both sources: both stay. Reconstruction is per scan
+ // and a BPR row and a DMV row never share a scan, so neither is a double count (#6931).
var primary = new List { Pair(201, 200, "BPR") };
BlockingPairRowMerge.MergeInto(primary, new[] { Pair(201, 200, "DMV") });
- Assert.Equal("BPR", Assert.Single(primary).BlockedSqlText);
+ Assert.Equal(new[] { "BPR", "DMV" }, primary.Select(r => r.BlockedSqlText));
}
[Fact]