Skip to content

Commit

Permalink
add timeout and retry to other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Mar 16, 2024
1 parent b08c404 commit 563065e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/indexer/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func mustMakeOperatorTransactor(env *deploy.Config, op deploy.OperatorVars, logg
RPCURLs: []string{deployer.RPC},
PrivateKeyString: op.NODE_PRIVATE_KEY,
NumConfirmations: 0,
NetworkTimeout: 3 * time.Second,
NumRetries: 0,
}

c, err := geth.NewClient(config, 0, logger)
Expand All @@ -96,6 +98,8 @@ func mustMakeTestClients(env *deploy.Config, privateKey string, logger logging.L
RPCURLs: []string{deployer.RPC},
PrivateKeyString: privateKey,
NumConfirmations: 0,
NetworkTimeout: 3 * time.Second,
NumRetries: 0,
}

client, err := geth.NewClient(config, 0, logger)
Expand Down
2 changes: 2 additions & 0 deletions core/thegraph/state_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func mustMakeTestClient(t *testing.T, env *deploy.Config, privateKey string, log
RPCURLs: []string{deployer.RPC},
PrivateKeyString: privateKey,
NumConfirmations: 0,
NetworkTimeout: 3 * time.Second,
NumRetries: 0,
}

client, err := geth.NewClient(config, 0, logger)
Expand Down
2 changes: 2 additions & 0 deletions operators/churner/churner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func TestProcessChurnRequest(t *testing.T) {
EthClientConfig: geth.EthClientConfig{
PrivateKeyString: churnerPrivateKeyHex,
NumConfirmations: 0,
NetworkTimeout: networkTimeout,
NumRetries: numRetries,
},
}
metrics := churner.NewMetrics("9001", logger)
Expand Down
5 changes: 5 additions & 0 deletions operators/churner/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"math/big"
"testing"
"time"

"github.com/Layr-Labs/eigenda/common"
"github.com/Layr-Labs/eigenda/common/geth"
Expand Down Expand Up @@ -33,6 +34,8 @@ var (
operatorToChurnInPrivateKeyHex = "0000000000000000000000000000000000000000000000000000000000000020"
churnerPrivateKeyHex = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
expectedReplySignature = []byte{0x4, 0xc, 0x2b, 0xd1, 0xce, 0xde, 0xb8, 0xbf, 0xb6, 0xba, 0x99, 0x3, 0x96, 0x57, 0x86, 0xcc, 0x4c, 0xf4, 0xed, 0xcf, 0x2f, 0xdb, 0x64, 0xf1, 0xca, 0x6, 0x80, 0x37, 0xd6, 0x6a, 0xf5, 0x92, 0x64, 0x49, 0x1c, 0xcb, 0x7d, 0xa5, 0x11, 0x9a, 0xb2, 0xab, 0x3, 0x11, 0x87, 0x31, 0x84, 0xd8, 0xff, 0xd, 0xd5, 0xd, 0x75, 0x93, 0xbd, 0x7, 0xf4, 0x2b, 0x2, 0x32, 0xa6, 0xf2, 0xb, 0xf1, 0x1c}
networkTimeout = 3 * time.Second
numRetries = 0
)

func TestChurn(t *testing.T) {
Expand Down Expand Up @@ -166,6 +169,8 @@ func newTestServer(t *testing.T) *churner.Server {
LoggerConfig: common.DefaultLoggerConfig(),
EthClientConfig: geth.EthClientConfig{
PrivateKeyString: churnerPrivateKeyHex,
NetworkTimeout: networkTimeout,
NumRetries: numRetries,
},
}

Expand Down
6 changes: 6 additions & 0 deletions operators/churner/tests/churner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var (
operatorAddr = ""
churnerPrivateKeyHex = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
operatorToChurnInPrivateKeyHex = "0000000000000000000000000000000000000000000000000000000000000020"
networkTimeout = 3 * time.Second
numRetries = 0
)

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -191,6 +193,8 @@ func createTransactorFromScratch(privateKey, operatorStateRetriever, serviceMana
RPCURLs: []string{rpcURL},
PrivateKeyString: privateKey,
NumConfirmations: 0,
NetworkTimeout: networkTimeout,
NumRetries: numRetries,
}

gethClient, err := geth.NewMultiHomingClient(ethClientCfg, logger)
Expand All @@ -207,6 +211,8 @@ func newTestServer(t *testing.T) *churner.Server {
EthClientConfig: geth.EthClientConfig{
RPCURLs: []string{rpcURL},
PrivateKeyString: churnerPrivateKeyHex,
NetworkTimeout: networkTimeout,
NumRetries: numRetries,
},
LoggerConfig: common.DefaultLoggerConfig(),
BLSOperatorStateRetrieverAddr: testConfig.EigenDA.OperatorStateRetreiver,
Expand Down

0 comments on commit 563065e

Please sign in to comment.