From 389e2f7a23509ae5b4366d4bbafeae8d67911025 Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Wed, 14 Aug 2024 08:12:39 +0700 Subject: [PATCH] Kraken: Fix TestGetOpenInterest 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 --- exchanges/kraken/kraken_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exchanges/kraken/kraken_test.go b/exchanges/kraken/kraken_test.go index edf457f8caa..31e2a08b769 100644 --- a/exchanges/kraken/kraken_test.go +++ b/exchanges/kraken/kraken_test.go @@ -2251,6 +2251,9 @@ 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, @@ -2258,8 +2261,8 @@ func TestGetOpenInterest(t *testing.T) { }) 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("ETHUSD")) sharedtestvalues.SetupCurrencyPairsForExchangeAsset(t, k, asset.Futures, cp1, cp2) resp, err := k.GetOpenInterest(context.Background(), key.PairAsset{