Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Enable block storage init test #1569

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions docker/test/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -xe

# Important note: trying to run the stress test locally? you will need to increase your max allowed sockets open / open files
# as shown in this stack overflow URL:
Expand All @@ -24,30 +24,19 @@ rm -rf _logs _out

[[ -z $CONSENSUSALGO ]] && echo "Consensus algo is not set! quiting.." && exit 1

# Only in Lean Helix disable the initial block height test for now
if [[ $CONSENSUSALGO == "leanhelix" ]]; then
export REMOTE_ENV="true"
fi

export GIT_BRANCH=$(source ./docker/tag.sh)
export GIT_COMMIT=$(git rev-parse HEAD)
export SRC=/go/src/github.com/orbs-network/orbs-network-go

# prepare persistent blocks for docker tests
# skip on Mac
if [[ $(uname) == "Linux" ]]; then
sudo rm -rf _tmp/blocks
fi

# At the moment Lean Helix doesn't deal well with an existing blocks file
if [[ $CONSENSUSALGO == "benchmark" ]]; then
mkdir -p _tmp/blocks/node{1..4}
# this is a weird trick to get around filesystem permissions to avoid using sudo and blocking things on Mac
docker run --rm -ti -v $(pwd)/_tmp:/opt/_tmp busybox sh -c "rm -rf /opt/_tmp/* && mkdir -p /opt/_tmp/blocks/node{1..4} && chmod -R 0777 /opt/_tmp/"

# We do not copy blocks for node1 to check the block sync
cp ./test/e2e/_data/blocks _tmp/blocks/node1
cp ./test/e2e/_data/blocks _tmp/blocks/node2
cp ./test/e2e/_data/blocks _tmp/blocks/node3
cp ./test/e2e/_data/blocks _tmp/blocks/node4
fi
#cp ./test/e2e/_data/blocks _tmp/blocks/node4

# run docker-reliant tests
docker-compose -f ./docker/test/docker-compose.yml up -d
Expand All @@ -57,9 +46,7 @@ if [ $EXIT_CODE -ne 0 ]
fi

export API_ENDPOINT=http://localhost:8082/api/v1/ \
# MGMT_API_ENDPOINT=http://localhost:8086/api/v1/ \
VCHAIN=42 \
# MGMT_VCHAIN=40 \
STRESS_TEST_NUMBER_OF_TRANSACTIONS=5000 \
STRESS_TEST_FAILURE_RATE=20 \
STRESS_TEST_TARGET_TPS=100 \
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ package e2e
import (
"encoding/json"
"fmt"
"github.com/orbs-network/crypto-lib-go/crypto/keys"
"github.com/orbs-network/orbs-client-sdk-go/codec"
orbsClient "github.com/orbs-network/orbs-client-sdk-go/orbs"
"github.com/orbs-network/orbs-network-go/config"
"github.com/orbs-network/crypto-lib-go/crypto/keys"
"github.com/orbs-network/orbs-network-go/test"
"github.com/orbs-network/orbs-spec/types/go/primitives"
"github.com/pkg/errors"
Expand Down Expand Up @@ -190,7 +190,7 @@ func (h *Harness) DeployContractAndRequireSuccess(t *testing.T, keyPair *keys.Ed
func (h *Harness) WaitUntilTransactionPoolIsReady(t *testing.T) {

recentBlockTimeDiff := getE2ETransactionPoolNodeSyncRejectTime() / 2
require.True(t, test.Eventually(15*time.Second, func() bool {
require.True(t, test.Eventually(1*time.Minute, func() bool {

m := h.GetMetrics()
if m == nil {
Expand Down