Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ping-ke committed Aug 5, 2024
1 parent 5485429 commit 5785c1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]
jobs:
es-node-integration-test:
runs-on: self-hosted
timeout-minutes: 2880
timeout-minutes: 1440

steps:
- uses: actions/checkout@v3
Expand All @@ -24,7 +24,7 @@ jobs:
with:
version: nightly

- name: Checkout Contracts
- name: Deploy Contracts
run: |
cd ../storage-contracts-v1
git checkout integration-test
Expand Down
14 changes: 9 additions & 5 deletions cmd/integration-test-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ var (
)

var (
errorMessages = make([]string, 0)
lastQueryTime = time.Now()
lastRecord *node.NodeState
errorMessages = make([]string, 0)
lastQueryTime = time.Now()
lastRecord *node.NodeState
hasConnectedPeer = false
)

func HelloHandler(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -96,8 +97,8 @@ func checkState(oldState, newState *node.NodeState) {
continue
}
check = true
if shardState.SyncState.PeerCount <= 0 {
addErrorMessage("es-node peer count should larger than 0")
if shardState.SyncState.PeerCount > 0 {
hasConnectedPeer = true
}

if oldShardState.SyncState.SyncProgress < 10000 &&
Expand Down Expand Up @@ -131,6 +132,9 @@ func checkFinalState(state *node.NodeState) {
addErrorMessage("No state submitted during the test")
return
}
if !hasConnectedPeer {
addErrorMessage("es-node peer count should larger than 0")
}

log.Info("Final state", "id", state.Id, "version", state.Version)
for _, shardState := range state.Shards {
Expand Down

0 comments on commit 5785c1f

Please sign in to comment.