engine/DataHistoryManager: Fix race condition in TestRunJob by isolating DHM instances (#2082)

* Initial plan

* Fix race condition in TestRunJob by creating separate DHM instances

Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thrasher- <4685270+thrasher-@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-16 13:50:32 +11:00
committed by GitHub
parent 7134ea0393
commit 5d4e5b0627

View File

@@ -582,13 +582,13 @@ func TestRunJob(t *testing.T) {
},
}
m, _ := createDHM(t)
m.tradeSaver = dataHistoryTradeSaver
m.candleSaver = dataHistoryCandleSaver
m.tradeLoader = dataHistoryTraderLoader
for _, tc := range testCases {
t.Run(tc.Nickname, func(t *testing.T) {
t.Parallel()
m, _ := createDHM(t)
m.tradeSaver = dataHistoryTradeSaver
m.candleSaver = dataHistoryCandleSaver
m.tradeLoader = dataHistoryTraderLoader
err := m.UpsertJob(tc, false)
assert.NoError(t, err)