Skip to content

Commit

Permalink
Kraken: Fix TestGetOpenInterest
Browse files Browse the repository at this point in the history
We see daily failures on OpenInterest for Kraken.
This fix assumes that the issue might be related to volume of ETHUSD
open interest, and switches the single pair test to XBTUSD instead

Also isolates the test from others, since we're changing stored pairs
and we might be colliding on the global k
  • Loading branch information
gbjk committed Aug 14, 2024
1 parent b602d54 commit ee5067d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions exchanges/kraken/kraken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2251,15 +2251,18 @@ func TestIsPerpetualFutureCurrency(t *testing.T) {

func TestGetOpenInterest(t *testing.T) {
t.Parallel()
k := new(Kraken) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(k), "Test instance Setup must not error")

_, err := k.GetOpenInterest(context.Background(), key.PairAsset{
Base: currency.ETH.Item,
Quote: currency.USDT.Item,
Asset: asset.USDTMarginedFutures,
})
assert.ErrorIs(t, err, asset.ErrNotSupported)

cp1 := currency.NewPair(currency.PF, currency.NewCode("ETHUSD"))
cp2 := currency.NewPair(currency.PF, currency.NewCode("XBTUSD"))
cp1 := currency.NewPair(currency.PF, currency.NewCode("XBTUSD"))
cp2 := currency.NewPair(currency.PF, currency.NewCode("ETHUSD"))
sharedtestvalues.SetupCurrencyPairsForExchangeAsset(t, k, asset.Futures, cp1, cp2)

resp, err := k.GetOpenInterest(context.Background(), key.PairAsset{
Expand Down

0 comments on commit ee5067d

Please sign in to comment.