From f220328ae41c53b3d08206eb3c1d14516b2c403d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 9 Mar 2026 19:33:06 -0700 Subject: [PATCH] test: assert ReadFileStatusCount in batch execution test Verify that pre-delete verification called ReadVolumeFileStatus on both source and target for each volume move. --- test/plugin_workers/volume_balance/execution_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/plugin_workers/volume_balance/execution_test.go b/test/plugin_workers/volume_balance/execution_test.go index e7c13154b..6e711227d 100644 --- a/test/plugin_workers/volume_balance/execution_test.go +++ b/test/plugin_workers/volume_balance/execution_test.go @@ -139,6 +139,13 @@ func TestVolumeBalanceBatchExecutionIntegration(t *testing.T) { require.True(t, deletedVols[vid], "volume %d should have been deleted from source", vid) } + // Pre-delete verification should have called ReadVolumeFileStatus on both + // source and target for each volume. + require.Equal(t, len(volumeIDs), source.ReadFileStatusCount(), + "each move should read source volume status before delete") + require.Equal(t, len(volumeIDs), target.ReadFileStatusCount(), + "each move should read target volume status before delete") + // Target should have received copy and tail calls for all 3 volumes. copyCalls, _, tailCalls := target.BalanceStats() require.Equal(t, len(volumeIDs), copyCalls, "target should receive one copy per volume")