refactor(tests): improve transaction waiting logic and epoch checks i…#5057
Draft
Frozen wants to merge 2 commits into
Draft
refactor(tests): improve transaction waiting logic and epoch checks i…#5057Frozen wants to merge 2 commits into
Frozen wants to merge 2 commits into
Conversation
mur-me
requested changes
Jun 15, 2026
| go-version: '1.24.2' | ||
| cache-dependency-path: go/src/github.com/harmony-one/harmony/go.sum | ||
|
|
||
| - &cache-native-libs |
Collaborator
There was a problem hiding this comment.
Idea is good, but you aren't changing the way how CI works rn, because bls and mcl are still building every time.
Main idea of cache is to cache some actions one time and skip them on the next run if they are present.
What we are seeing on the 2 runs of the same PR is almost same timing results.
- one thing -
makeon the harmony repo automatically build mcl and bls again.
Example diagram of the build stage:
flowchart TD
A["Checkout harmony/mcl/bls"] --> B["Set up Go"]
B --> C["actions/cache restores native mcl/bls cache"]
C --> D{"Exact cache hit?"}
D -->|yes| E["Cached bin/lib/obj restored"]
D -->|no| F["No exact cached native outputs"]
E --> G["Build mcl runs anyway"]
F --> G
G --> H["Build bls runs anyway"]
H --> I["Build harmony runs"]
I --> J["Job completes"]
J --> K{"Cache miss and job success?"}
K -->|yes| L["actions/cache may save native outputs"]
K -->|no| M["No new native cache saved"]
|
|
||
| - &cache-native-libs | ||
| name: Cache native mcl/bls libraries | ||
| uses: actions/cache@v4 |
Collaborator
There was a problem hiding this comment.
Lest use best practice here - last version + sha1 # v1.1.1 comment
| path: go/src/github.com/harmony-one/harmony-test | ||
| persist-credentials: false | ||
|
|
||
| - &setup-docker-buildx |
Collaborator
There was a problem hiding this comment.
why do we need this one?
all github runners has docker by default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the reliability and efficiency of test scripts by replacing fixed sleep intervals with readiness and polling scripts. The changes ensure that scripts wait for services or blockchain epochs to be ready before proceeding, reducing flakiness and unnecessary waiting time.
Test orchestration improvements:
Replaced fixed
sleep 10sdelays with a call to./test/wait_rpc_ready.shin severalMakefiletargets (debug-ext,debug-multi-bls,debug-multi-bls-with-terminal,debug-multi-bls-multi-ext-node), ensuring that the RPC endpoint is ready before starting the validator setup. [1] [2]In
test/build-localnet-validator.sh, replaced the epoch polling loop with a call to the new./test/wait_till_n_epoch.shscript for waiting until the blockchain reaches a specific epoch.Script enhancements:
Added a robust
test/wait_till_n_epoch.shscript that polls the node for the current epoch, supports configurable timeouts and intervals, and fails gracefully if the target epoch is not reached in time.Updated
scripts/api_test.shto replace fixedsleep 20swaits with a call to./test/wait_tx_receipt.sh, polling for transaction receipts instead of relying on arbitrary delays. [1] [2]