Skip to content

Commit

Permalink
increase DB timeout, pre-defined node names
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Feb 3, 2025
1 parent 376ab95 commit 11ff679
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
5 changes: 4 additions & 1 deletion framework/components/clnode/clnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
},
ExposedPorts: exposedPorts,
Entrypoint: generateEntryPoint(),
WaitingFor: wait.ForHTTP("/").WithPort(DefaultHTTPPort).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond),
WaitingFor: wait.ForHTTP("/").
WithPort(DefaultHTTPPort).
WithStartupTimeout(1 * time.Minute).
WithPollInterval(200 * time.Millisecond),
}
if in.Node.HTTPPort != 0 && in.Node.P2PPort != 0 {
req.HostConfigModifier = func(h *container.HostConfig) {
Expand Down
2 changes: 1 addition & 1 deletion framework/components/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func NewPostgreSQL(in *Input) (*Output, error) {
},
WaitingFor: tcwait.ForExec([]string{"psql", "-h", "127.0.0.1",
"-U", User, "-p", Port, "-c", "select", "1", "-d", Database}).
WithStartupTimeout(15 * time.Second).
WithStartupTimeout(40 * time.Second).
WithPollInterval(200 * time.Millisecond),
}
var portToExpose int
Expand Down
6 changes: 1 addition & 5 deletions framework/components/simple_node_set/node_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
if in.NodeSpecs[overrideIdx].Node.TestConfigOverrides != "" {
net = in.NodeSpecs[overrideIdx].Node.TestConfigOverrides
}
if in.NodeSpecs[overrideIdx].Node.Name == "" {
nodeName = fmt.Sprintf("node%d", i)
} else {
nodeName = in.NodeSpecs[overrideIdx].Node.Name
}
nodeName = fmt.Sprintf("node%d", i)
nodeWithNodeSetPrefixName := fmt.Sprintf("%s-%s", in.Name, nodeName)

nodeSpec := &clnode.Input{
Expand Down
8 changes: 4 additions & 4 deletions framework/components/simple_node_set/nodeset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ func checkBasicOutputs(t *testing.T, output *ns.Output) {
require.NotNil(t, output.CLNodes)
require.Len(t, output.CLNodes, 2)
require.Contains(t, output.CLNodes[0].PostgreSQL.Url, "postgresql://chainlink:[email protected]")
require.Contains(t, output.CLNodes[0].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql-")
require.Contains(t, output.CLNodes[0].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@don")
require.Contains(t, output.CLNodes[0].Node.HostURL, "127.0.0.1")
require.Contains(t, output.CLNodes[0].Node.DockerURL, "node")
require.Contains(t, output.CLNodes[0].Node.DockerP2PUrl, "node")

require.Contains(t, output.CLNodes[1].PostgreSQL.Url, "postgresql://chainlink:[email protected]")
require.Contains(t, output.CLNodes[1].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql-")
require.Contains(t, output.CLNodes[1].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@don")
require.Contains(t, output.CLNodes[1].Node.HostURL, "127.0.0.1")
require.Contains(t, output.CLNodes[1].Node.DockerURL, "node")
require.Contains(t, output.CLNodes[1].Node.DockerP2PUrl, "node")
Expand All @@ -47,7 +47,7 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
ChainID: "31337",
},
nodeSetInput: &ns.Input{
Name: "don",
Name: "don-1",
Nodes: 2,
OverrideMode: "all",
DbInput: &postgres.Input{
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
ChainID: "31337",
},
nodeSetInput: &ns.Input{
Name: "don",
Name: "don-2",
Nodes: 2,
OverrideMode: "each",
HTTPPortRangeStart: 20000,
Expand Down
4 changes: 2 additions & 2 deletions framework/examples/myproject/upgrade_multi_nodeset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestMultiUpgrade(t *testing.T) {
level = 'info'
`

ns1, err = ns.UpgradeNodeSet(t, in.NodeSetA, bc, 5*time.Second)
ns1, err = ns.UpgradeNodeSet(t, in.NodeSetA, bc, 3*time.Second)
require.NoError(t, err)

in.NodeSetB.NodeSpecs[0].Node.Image = "public.ecr.aws/chainlink/chainlink:v2.17.0"
Expand All @@ -49,7 +49,7 @@ func TestMultiUpgrade(t *testing.T) {
level = 'info'
`

ns2, err = ns.UpgradeNodeSet(t, in.NodeSetB, bc, 5*time.Second)
ns2, err = ns.UpgradeNodeSet(t, in.NodeSetB, bc, 3*time.Second)
require.NoError(t, err)

t.Run("test something", func(t *testing.T) {
Expand Down

0 comments on commit 11ff679

Please sign in to comment.