Skip to content

Commit 7ea1859

Browse files
authored
[DX-954] wait longer for some containers to start (#1860)
* increase startup timeout to at least 1 minute for blockchains and 3 minutes for cl node/pg
1 parent 5d91368 commit 7ea1859

File tree

8 files changed

+8
-6
lines changed

8 files changed

+8
-6
lines changed

framework/.changeset/v0.8.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Increase blockchain, CL node and Postgres containers startup times

framework/components/blockchain/containers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func baseRequest(in *Input, useWS ExposeWs) testcontainers.ContainerRequest {
4141
h.PortBindings = framework.MapTheSamePort(exposedPorts...)
4242
}
4343
},
44-
WaitingFor: wait.ForListeningPort(nat.Port(in.Port)).WithStartupTimeout(15 * time.Second).WithPollInterval(200 * time.Millisecond),
44+
WaitingFor: wait.ForListeningPort(nat.Port(in.Port)).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond),
4545
}
4646
if !in.HostNetworkMode {
4747
req.ExposedPorts = exposedPorts

framework/components/blockchain/solana.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func newSolana(in *Input) (*Output, error) {
103103
framework.DefaultNetworkName: {containerName},
104104
},
105105
WaitingFor: wait.ForLog("Processed Slot: 1").
106-
WithStartupTimeout(30 * time.Second).
106+
WithStartupTimeout(1 * time.Minute).
107107
WithPollInterval(100 * time.Millisecond),
108108
HostConfigModifier: func(h *container.HostConfig) {
109109
h.PortBindings = framework.MapTheSamePort(bindPort, wsBindPort)

framework/components/blockchain/sui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func newSui(in *Input) (*Output, error) {
129129
},
130130
},
131131
// we need faucet for funding
132-
WaitingFor: wait.ForListeningPort(DefaultFaucetPort).WithStartupTimeout(10 * time.Second).WithPollInterval(200 * time.Millisecond),
132+
WaitingFor: wait.ForListeningPort(DefaultFaucetPort).WithStartupTimeout(1 * time.Minute).WithPollInterval(200 * time.Millisecond),
133133
}
134134

135135
c, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{

framework/components/clnode/clnode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
249249
Entrypoint: generateEntryPoint(),
250250
WaitingFor: wait.ForHTTP("/").
251251
WithPort(DefaultHTTPPort).
252-
WithStartupTimeout(1 * time.Minute).
252+
WithStartupTimeout(3 * time.Minute).
253253
WithPollInterval(200 * time.Millisecond),
254254
}
255255
if in.Node.HTTPPort != 0 && in.Node.P2PPort != 0 {

framework/components/postgres/postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func NewPostgreSQL(in *Input) (*Output, error) {
133133
},
134134
WaitingFor: tcwait.ForExec([]string{"psql", "-h", "127.0.0.1",
135135
"-U", User, "-p", Port, "-c", "select", "1", "-d", Database}).
136-
WithStartupTimeout(40 * time.Second).
136+
WithStartupTimeout(3 * time.Minute).
137137
WithPollInterval(200 * time.Millisecond),
138138
}
139139
var portToExpose int

framework/components/simple_node_set/node_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
191191
}
192192

193193
func sortNodeOutsByHostPort(nodes []*clnode.Output) {
194-
slices.SortFunc[[]*clnode.Output, *clnode.Output](nodes, func(a, b *clnode.Output) int {
194+
slices.SortFunc(nodes, func(a, b *clnode.Output) int {
195195
aa := strings.Split(a.Node.ExternalURL, ":")
196196
bb := strings.Split(b.Node.ExternalURL, ":")
197197
if aa[len(aa)-1] < bb[len(bb)-1] {

lib/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.24.0

0 commit comments

Comments
 (0)