mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user