Skip to content
Merged
25 changes: 15 additions & 10 deletions cmd/beekeeper/cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,27 @@ func (c *command) initCheckCmd() (err error) {
}
chk = beekeeper.NewActionMiddleware(tracer, chk, checkName)

if checkConfig.Timeout != nil {
ctx, cancel = context.WithTimeout(ctx, *checkConfig.Timeout)
defer cancel()
}
checkCtx, cancelCheck := createChildContext(ctx, checkConfig.Timeout)
defer cancelCheck()

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

ch := make(chan error, 1)
go func() {
ch <- chk.Run(ctx, cluster, o)
ch <- chk.Run(checkCtx, cluster, o)
close(ch)
}()

select {
case <-ctx.Done():
deadline, ok := ctx.Deadline()
case <-checkCtx.Done():
deadline, ok := checkCtx.Deadline()
if ok {
return fmt.Errorf("running check %s: %w: deadline %v", checkName, ctx.Err(), deadline)
return fmt.Errorf("running check %s: %w: deadline %v", checkName, checkCtx.Err(), deadline)
}
return fmt.Errorf("running check %s: %w", checkName, ctx.Err())
return fmt.Errorf("check %s failed due to: %w", checkName, checkCtx.Err())
case err = <-ch:
if err != nil {
return fmt.Errorf("running check %s: %w", checkName, err)
return fmt.Errorf("check %s failed with error: %w", checkName, err)
}
c.log.Infof("%s check completed successfully", checkName)
}
Expand All @@ -159,3 +157,10 @@ func (c *command) initCheckCmd() (err error) {

return nil
}

func createChildContext(ctx context.Context, timeout *time.Duration) (context.Context, context.CancelFunc) {
if timeout != nil {
return context.WithTimeout(ctx, *timeout)
}
return context.WithCancel(ctx)
}
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ checks:
insufficient-amount: 102400
contract-addr: "0xfc28330f1ecE0ef2371B724E0D19c1EE60B728b2"
private-key: "4663c222787e30c1994b59044aa5045377a6e79193a8ead88293926b535c722d"
geth-url: "http://geth-swap.bee-playground.testnet.internal"
geth-url: "http://geth-swap.bee-playground.svc.swarm1.local:8545"
geth-chain-id: 12345
withdraw:
options:
Expand Down
8 changes: 7 additions & 1 deletion config/public-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ bee-configs:
sepolia:
_inherit: ""
bootnodes: "/dnsaddr/testnet.ethswarm.org"
full-node: true

checks:
pt-pingpong:
options:
timeout: 30m
type: pingpong
pt-retrieval:
options:
chunks-per-node: 3
Expand Down Expand Up @@ -76,7 +81,7 @@ checks:
max-pathname-length: 64
postage-amount: 140000000
postage-depth: 17
timeout: 5m
timeout: 30m
type: manifest
pt-pss:
options:
Expand Down Expand Up @@ -146,6 +151,7 @@ checks:
postage-amount: 140000000
postage-depth: 20
postage-label: feed-label
timeout: 30m
type: feed
pt-feed-availability:
options:
Expand Down
4 changes: 4 additions & 0 deletions pkg/check/pushsync/check_chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func checkChunks(ctx context.Context, c orchestration.Cluster, o Options, l logg

sortedNodes := c.FullNodeNames()

if o.UploadNodeCount > len(sortedNodes) {
return fmt.Errorf("not enough nodes in the cluster to run the test, required %d, available %d", o.UploadNodeCount, len(sortedNodes))
}

for i := 0; i < o.UploadNodeCount; i++ {

nodeName := sortedNodes[i]
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package beekeeper

var (
version = "0.22.0" // manually set semantic version number
version = "0.23.2" // manually set semantic version number
commit string // automatically set git commit hash

// Version TODO
Expand Down
Loading