-
Notifications
You must be signed in to change notification settings - Fork 662
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
[antithesis] Remove assertions incompatible with fault injection #3104
Merged
Merged
Changes from 2 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,10 +263,6 @@ func (w *workload) issueXChainBaseTx(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain baseTx: %s", err) | ||
assert.Unreachable("failed to issue X-chain baseTx", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("issued new X-chain baseTx %s in %s", baseTx.ID(), time.Since(baseStartTime)) | ||
|
@@ -320,10 +316,6 @@ func (w *workload) issueXChainCreateAssetTx(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain create asset transaction: %s", err) | ||
assert.Unreachable("failed to issue X-chain create asset transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created new X-chain asset %s in %s", createAssetTx.ID(), time.Since(createAssetStartTime)) | ||
|
@@ -378,10 +370,6 @@ func (w *workload) issueXChainOperationTx(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain create asset transaction: %s", err) | ||
assert.Unreachable("failed to issue X-chain create asset transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created new X-chain asset %s in %s", createAssetTx.ID(), time.Since(createAssetStartTime)) | ||
|
@@ -393,10 +381,6 @@ func (w *workload) issueXChainOperationTx(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain operation transaction: %s", err) | ||
assert.Unreachable("failed to issue X-chain operation transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("issued X-chain operation tx %s in %s", operationTx.ID(), time.Since(operationStartTime)) | ||
|
@@ -456,10 +440,6 @@ func (w *workload) issueXToPTransfer(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain export transaction: %s", err) | ||
assert.Unreachable("failed to issue X-chain export transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created X-chain export transaction %s in %s", exportTx.ID(), time.Since(exportStartTime)) | ||
|
@@ -474,10 +454,6 @@ func (w *workload) issueXToPTransfer(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue P-chain import transaction: %s", err) | ||
assert.Unreachable("failed to issue P-chain import transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created P-chain import transaction %s in %s", importTx.ID(), time.Since(importStartTime)) | ||
|
@@ -538,10 +514,6 @@ func (w *workload) issuePToXTransfer(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue P-chain export transaction: %s", err) | ||
assert.Unreachable("failed to issue P-chain export transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created P-chain export transaction %s in %s", exportTx.ID(), time.Since(exportStartTime)) | ||
|
@@ -553,10 +525,6 @@ func (w *workload) issuePToXTransfer(ctx context.Context) { | |
) | ||
if err != nil { | ||
log.Printf("failed to issue X-chain import transaction: %s", err) | ||
assert.Unreachable("failed to issue X-chain import transaction", map[string]any{ | ||
"worker": w.id, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
log.Printf("created X-chain import transaction %s in %s", importTx.ID(), time.Since(importStartTime)) | ||
|
@@ -584,22 +552,10 @@ func (w *workload) confirmXChainTx(ctx context.Context, tx *xtxs.Tx) { | |
status, err := client.ConfirmTx(ctx, txID, 100*time.Millisecond) | ||
if err != nil { | ||
log.Printf("failed to confirm X-chain transaction %s on %s: %s", txID, uri, err) | ||
assert.Unreachable("failed to determine the status of an X-chain transaction", map[string]any{ | ||
"worker": w.id, | ||
"txID": txID, | ||
"uri": uri, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
if status != choices.Accepted { | ||
log.Printf("failed to confirm X-chain transaction %s on %s: status == %s", txID, uri, status) | ||
assert.Unreachable("failed to confirm an X-chain transaction", map[string]any{ | ||
"worker": w.id, | ||
"txID": txID, | ||
"uri": uri, | ||
"status": status, | ||
}) | ||
return | ||
} | ||
log.Printf("confirmed X-chain transaction %s on %s", txID, uri) | ||
|
@@ -614,22 +570,10 @@ func (w *workload) confirmPChainTx(ctx context.Context, tx *ptxs.Tx) { | |
s, err := client.AwaitTxDecided(ctx, txID, 100*time.Millisecond) | ||
if err != nil { | ||
log.Printf("failed to determine the status of a P-chain transaction %s on %s: %s", txID, uri, err) | ||
assert.Unreachable("failed to determine the status of a P-chain transaction", map[string]any{ | ||
"worker": w.id, | ||
"txID": txID, | ||
"uri": uri, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
if s.Status != status.Committed { | ||
log.Printf("failed to confirm P-chain transaction %s on %s: status == %s", txID, uri, s.Status) | ||
assert.Unreachable("failed to confirm a P-chain transaction", map[string]any{ | ||
"worker": w.id, | ||
"txID": txID, | ||
"uri": uri, | ||
"status": s.Status, | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's my understanding that this assertion could remain. (I'd be interested if it couldn't stay) |
||
return | ||
} | ||
log.Printf("confirmed P-chain transaction %s on %s", txID, uri) | ||
|
@@ -655,12 +599,6 @@ func (w *workload) verifyXChainTxConsumedUTXOs(ctx context.Context, tx *xtxs.Tx) | |
) | ||
if err != nil { | ||
log.Printf("failed to fetch X-chain UTXOs on %s: %s", uri, err) | ||
assert.Unreachable("failed to fetch X-chain UTXOs", map[string]any{ | ||
"worker": w.id, | ||
"txID": txID, | ||
"uri": uri, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
|
||
|
@@ -701,12 +639,6 @@ func (w *workload) verifyPChainTxConsumedUTXOs(ctx context.Context, tx *ptxs.Tx) | |
) | ||
if err != nil { | ||
log.Printf("failed to fetch P-chain UTXOs on %s: %s", uri, err) | ||
assert.Unreachable("failed to fetch P-chain UTXOs", map[string]any{ | ||
"worker": w.id, | ||
"uri": uri, | ||
"txID": txID, | ||
"err": err, | ||
}) | ||
return | ||
} | ||
|
||
|
This file contains 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.
It's my understanding that this assertion could remain. (I'd be interested if it couldn't stay)
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.
As I understand it, if this hits an error here: https://github.com/ava-labs/avalanchego/blob/master/wallet/chain/x/wallet.go#L303 when issuing the transaction while the node is down due to an injected failure then the test will fail incorrectlyIgnore my comment - this is specifically checking the status that was returned assuming the API call has already returned without an error.