From da09f53610f1e6c6d673fe56a0bb7f86bca7a111 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 13 Sep 2023 16:55:58 +0200 Subject: [PATCH] Commenting the integration tests Commenting this test because as a side effect it exposed another known issue which now happens very often because of this test. It's becoming annoying having red builds because of this test. It should be uncommented once the fix for https://github.com/checksum0/go-electrum/issues/10 is in place. --- .../electrum/electrum_integration_test.go | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/pkg/bitcoin/electrum/electrum_integration_test.go b/pkg/bitcoin/electrum/electrum_integration_test.go index 4be4fa9fa2..c5b80c8710 100644 --- a/pkg/bitcoin/electrum/electrum_integration_test.go +++ b/pkg/bitcoin/electrum/electrum_integration_test.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "strings" - "sync" "testing" "time" @@ -233,42 +232,48 @@ func TestGetTransactionConfirmations_Negative_Integration(t *testing.T) { }) } -func TestGetLatestBlockHeightConcurrently_Integration(t *testing.T) { - goroutines := 20 +// TODO: We should uncomment this test once https://github.com/checksum0/go-electrum/issues/10 +// is fixed. This test was added to validate the fix of the following issue +// https://github.com/keep-network/keep-core/issues/3699 but at the same time +// made `panic: assignment to entry in nil map` happen very frequently which is +// disturbing during the development and running the existing integration tests. - for testName, testConfig := range testConfigs { - t.Run(testName+"_get", func(t *testing.T) { - electrum, cancelCtx := newTestConnection(t, testConfig.clientConfig) - defer cancelCtx() +// func TestGetLatestBlockHeightConcurrently_Integration(t *testing.T) { +// goroutines := 20 - var wg sync.WaitGroup +// for testName, testConfig := range testConfigs { +// t.Run(testName+"_get", func(t *testing.T) { +// electrum, cancelCtx := newTestConnection(t, testConfig.clientConfig) +// defer cancelCtx() - for i := 0; i < goroutines; i++ { - wg.Add(1) +// var wg sync.WaitGroup - go func() { - result, err := electrum.GetLatestBlockHeight() +// for i := 0; i < goroutines; i++ { +// wg.Add(1) - if err != nil { - t.Fatal(err) - } +// go func() { +// result, err := electrum.GetLatestBlockHeight() - if result == 0 { - t.Errorf( - "returned block height is 0", - ) - } +// if err != nil { +// t.Fatal(err) +// } - wg.Done() - }() - } +// if result == 0 { +// t.Errorf( +// "returned block height is 0", +// ) +// } - wg.Wait() - }) +// wg.Done() +// }() +// } - // Passed if no "panic: concurrent write to websocket connection" - } -} +// wg.Wait() +// }) + +// // Passed if no "panic: concurrent write to websocket connection" +// } +// } func TestGetLatestBlockHeight_Integration(t *testing.T) { expectedBlockHeightRef := map[string]uint{}