Kucoin: Fix intermittent TestPushData failure (#2116)

* Testing: Fix FixtureToDataHandlerWithErrors logging []byte

* Kucoin: Fix global mutexes and maps

Highlighted by:
```
go test -count 2 -run TestPushData
```

that the second run wasn't finding a futures orderbook, because the
instance had changed but kucoin was using a global map
This commit is contained in:
Gareth Kirwan
2025-12-01 07:07:13 +07:00
committed by GitHub
parent dbf3b772b6
commit 6ae40f3688
4 changed files with 20 additions and 24 deletions

View File

@@ -133,7 +133,7 @@ func MockWsInstance[T any, PT interface {
// FixtureError contains an error and the message that caused it
type FixtureError struct {
Err error
Msg []byte
Msg string
}
// FixtureToDataHandler squirts the contents of a file to a reader function (probably e.wsHandleData) and asserts no errors are returned
@@ -163,7 +163,7 @@ func FixtureToDataHandlerWithErrors(tb testing.TB, fixturePath string, reader fu
if err := reader(tb.Context(), msg); err != nil {
errs = append(errs, FixtureError{
Err: err,
Msg: msg,
Msg: string(msg),
})
}
}