-
Notifications
You must be signed in to change notification settings - Fork 124
fix(tests/e2e): fix flaky E2E tests with node readiness checks and extended timeout #351
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
Open
g0spel
wants to merge
1
commit into
KiiChain:main
Choose a base branch
from
g0spel:fix/flaky-e2e-tests-176
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: KiiChain/kiichain
Length of output: 246
🏁 Script executed:
Repository: KiiChain/kiichain
Length of output: 222
🏁 Script executed:
Repository: KiiChain/kiichain
Length of output: 4759
🌐 Web query:
Cosmos SDK TxResponse json:"code,omitempty" tx_response code omitted on success /cosmos/tx/v1beta1/txs💡 Result:
In the Cosmos SDK, the
codefield in theTxResponseobject is typically omitted from JSON output on success because it is defined with theomitemptyJSON tag [1][2][3]. Since a successful transaction in the Cosmos SDK (specifically at the ABCI level) has a returncodeof0[4], the standard Gojsonmarshaler treats this as a zero value and omits it from the serialized output when thejson:"code,omitempty"tag is present. TheTxResponsestruct (found incosmos-sdk/types/result.go) is used across various endpoints, including those under/cosmos/tx/v1beta1/txs[1][5][3]. While the underlying protobuf definition and internal Go struct include thecodefield, its visibility in JSON responses is governed by the serialization rules of the SDK's encoding layer, which adheres to theomitemptyconvention for this field [1][6]. If you are developing a client (such as a frontend or a service consuming these APIs) and need to verify the success of a transaction, you should not rely solely on the presence or absence of thecodefield. Instead, standard practice is to: 1. Check if thecodefield exists and is equal to0(if present). 2. Alternatively, treat the absence of thecodefield as implicitly successful (i.e.,code == 0), given that the transaction was successfully processed by the node and returned aTxResponse[4]. For robust client-side logic, it is often recommended to use higher-level libraries (like CosmJS) which handle these serialization nuances and provide helper functions to distinguish between successful and failed transactions [4].Citations:
Unguarded
codeassertion can still panic on successful txs.txResp["code"]is omitted on success, sov.(float64)can hitniland crash this polling path.🐛 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents