Skip to content

Commit 5d28411

Browse files
fix(checks): enable multiple consecutive checks run for testnet (#449)
* fix(config): update stake geth-url to http://geth-swap.bee-playground.svc.swarm1.local * fix(config): add port to take geth-url * fix(config): set bee-testnet nodes to full-node * fix(config): increase timeout for some checks * fix(checks): create child timeout for each check * chore(config): add timeout check with 30m timeout * fix(checks): check for child context in select * chore: bump version to 0.23.2
1 parent 0b91024 commit 5d28411

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

cmd/beekeeper/cmd/check.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,27 @@ func (c *command) initCheckCmd() (err error) {
115115
}
116116
chk = beekeeper.NewActionMiddleware(tracer, chk, checkName)
117117

118-
if checkConfig.Timeout != nil {
119-
ctx, cancel = context.WithTimeout(ctx, *checkConfig.Timeout)
120-
defer cancel()
121-
}
118+
checkCtx, cancelCheck := createChildContext(ctx, checkConfig.Timeout)
119+
defer cancelCheck()
122120

123121
c.log.Infof("running check: %s", checkName)
124122

125123
ch := make(chan error, 1)
126124
go func() {
127-
ch <- chk.Run(ctx, cluster, o)
125+
ch <- chk.Run(checkCtx, cluster, o)
128126
close(ch)
129127
}()
130128

131129
select {
132-
case <-ctx.Done():
133-
deadline, ok := ctx.Deadline()
130+
case <-checkCtx.Done():
131+
deadline, ok := checkCtx.Deadline()
134132
if ok {
135-
return fmt.Errorf("running check %s: %w: deadline %v", checkName, ctx.Err(), deadline)
133+
return fmt.Errorf("running check %s: %w: deadline %v", checkName, checkCtx.Err(), deadline)
136134
}
137-
return fmt.Errorf("running check %s: %w", checkName, ctx.Err())
135+
return fmt.Errorf("check %s failed due to: %w", checkName, checkCtx.Err())
138136
case err = <-ch:
139137
if err != nil {
140-
return fmt.Errorf("running check %s: %w", checkName, err)
138+
return fmt.Errorf("check %s failed with error: %w", checkName, err)
141139
}
142140
c.log.Infof("%s check completed successfully", checkName)
143141
}
@@ -159,3 +157,10 @@ func (c *command) initCheckCmd() (err error) {
159157

160158
return nil
161159
}
160+
161+
func createChildContext(ctx context.Context, timeout *time.Duration) (context.Context, context.CancelFunc) {
162+
if timeout != nil {
163+
return context.WithTimeout(ctx, *timeout)
164+
}
165+
return context.WithCancel(ctx)
166+
}

config/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ checks:
348348
insufficient-amount: 102400
349349
contract-addr: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
350350
private-key: "4663c222787e30c1994b59044aa5045377a6e79193a8ead88293926b535c722d"
351-
geth-url: "http://geth-swap.bee-playground.testnet.internal"
351+
geth-url: "http://geth-swap.bee-playground.svc.swarm1.local:8545"
352352
geth-chain-id: 12345
353353
withdraw:
354354
options:

config/public-testnet.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ bee-configs:
4747
sepolia:
4848
_inherit: ""
4949
bootnodes: "/dnsaddr/testnet.ethswarm.org"
50+
full-node: true
5051

5152
checks:
53+
pt-pingpong:
54+
options:
55+
timeout: 30m
56+
type: pingpong
5257
pt-retrieval:
5358
options:
5459
chunks-per-node: 3
@@ -76,7 +81,7 @@ checks:
7681
max-pathname-length: 64
7782
postage-amount: 140000000
7883
postage-depth: 17
79-
timeout: 5m
84+
timeout: 30m
8085
type: manifest
8186
pt-pss:
8287
options:
@@ -146,6 +151,7 @@ checks:
146151
postage-amount: 140000000
147152
postage-depth: 20
148153
postage-label: feed-label
154+
timeout: 30m
149155
type: feed
150156
pt-feed-availability:
151157
options:

pkg/check/pushsync/check_chunks.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ func checkChunks(ctx context.Context, c orchestration.Cluster, o Options, l logg
3232

3333
sortedNodes := c.FullNodeNames()
3434

35+
if o.UploadNodeCount > len(sortedNodes) {
36+
return fmt.Errorf("not enough nodes in the cluster to run the test, required %d, available %d", o.UploadNodeCount, len(sortedNodes))
37+
}
38+
3539
for i := 0; i < o.UploadNodeCount; i++ {
3640

3741
nodeName := sortedNodes[i]

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package beekeeper
22

33
var (
4-
version = "0.22.0" // manually set semantic version number
4+
version = "0.23.2" // manually set semantic version number
55
commit string // automatically set git commit hash
66

77
// Version TODO

0 commit comments

Comments
 (0)