Skip to content

Commit 11ff679

Browse files
committed
increase DB timeout, pre-defined node names
1 parent 376ab95 commit 11ff679

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

framework/components/clnode/clnode.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,10 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
244244
},
245245
ExposedPorts: exposedPorts,
246246
Entrypoint: generateEntryPoint(),
247-
WaitingFor: wait.ForHTTP("/").WithPort(DefaultHTTPPort).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond),
247+
WaitingFor: wait.ForHTTP("/").
248+
WithPort(DefaultHTTPPort).
249+
WithStartupTimeout(1 * time.Minute).
250+
WithPollInterval(200 * time.Millisecond),
248251
}
249252
if in.Node.HTTPPort != 0 && in.Node.P2PPort != 0 {
250253
req.HostConfigModifier = func(h *container.HostConfig) {

framework/components/postgres/postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func NewPostgreSQL(in *Input) (*Output, error) {
111111
},
112112
WaitingFor: tcwait.ForExec([]string{"psql", "-h", "127.0.0.1",
113113
"-U", User, "-p", Port, "-c", "select", "1", "-d", Database}).
114-
WithStartupTimeout(15 * time.Second).
114+
WithStartupTimeout(40 * time.Second).
115115
WithPollInterval(200 * time.Millisecond),
116116
}
117117
var portToExpose int

framework/components/simple_node_set/node_set.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
131131
if in.NodeSpecs[overrideIdx].Node.TestConfigOverrides != "" {
132132
net = in.NodeSpecs[overrideIdx].Node.TestConfigOverrides
133133
}
134-
if in.NodeSpecs[overrideIdx].Node.Name == "" {
135-
nodeName = fmt.Sprintf("node%d", i)
136-
} else {
137-
nodeName = in.NodeSpecs[overrideIdx].Node.Name
138-
}
134+
nodeName = fmt.Sprintf("node%d", i)
139135
nodeWithNodeSetPrefixName := fmt.Sprintf("%s-%s", in.Name, nodeName)
140136

141137
nodeSpec := &clnode.Input{

framework/components/simple_node_set/nodeset_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ func checkBasicOutputs(t *testing.T, output *ns.Output) {
2424
require.NotNil(t, output.CLNodes)
2525
require.Len(t, output.CLNodes, 2)
2626
require.Contains(t, output.CLNodes[0].PostgreSQL.Url, "postgresql://chainlink:[email protected]")
27-
require.Contains(t, output.CLNodes[0].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql-")
27+
require.Contains(t, output.CLNodes[0].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@don")
2828
require.Contains(t, output.CLNodes[0].Node.HostURL, "127.0.0.1")
2929
require.Contains(t, output.CLNodes[0].Node.DockerURL, "node")
3030
require.Contains(t, output.CLNodes[0].Node.DockerP2PUrl, "node")
3131

3232
require.Contains(t, output.CLNodes[1].PostgreSQL.Url, "postgresql://chainlink:[email protected]")
33-
require.Contains(t, output.CLNodes[1].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@ns-postgresql-")
33+
require.Contains(t, output.CLNodes[1].PostgreSQL.DockerInternalURL, "postgresql://chainlink:thispasswordislongenough@don")
3434
require.Contains(t, output.CLNodes[1].Node.HostURL, "127.0.0.1")
3535
require.Contains(t, output.CLNodes[1].Node.DockerURL, "node")
3636
require.Contains(t, output.CLNodes[1].Node.DockerP2PUrl, "node")
@@ -47,7 +47,7 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
4747
ChainID: "31337",
4848
},
4949
nodeSetInput: &ns.Input{
50-
Name: "don",
50+
Name: "don-1",
5151
Nodes: 2,
5252
OverrideMode: "all",
5353
DbInput: &postgres.Input{
@@ -75,7 +75,7 @@ func TestComponentDockerNodeSetSharedDB(t *testing.T) {
7575
ChainID: "31337",
7676
},
7777
nodeSetInput: &ns.Input{
78-
Name: "don",
78+
Name: "don-2",
7979
Nodes: 2,
8080
OverrideMode: "each",
8181
HTTPPortRangeStart: 20000,

framework/examples/myproject/upgrade_multi_nodeset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestMultiUpgrade(t *testing.T) {
4040
level = 'info'
4141
`
4242

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

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

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

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

0 commit comments

Comments
 (0)