Skip to content

Commit

Permalink
fix(graphql): flakiness in pruning test
Browse files Browse the repository at this point in the history
## Description

Fix some flakiness in the `prune.move` by removing the initial
checkpoints query which may witness different degrees of pruning.

## Test plan

Run the E2E tests in a loop -- previously this would trigger the failure
after some time (usually fewer than 10 runs) and after this change, the
same thing does not happen:

```
sui$ while true; do
  cargo nextest run -p sui-graphql-e2e-tests
done
```
  • Loading branch information
amnn committed Sep 18, 2024
1 parent 3c1c5ef commit 9912f6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 69 deletions.
57 changes: 2 additions & 55 deletions crates/sui-graphql-e2e-tests/tests/stable/prune.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 13 tasks
processed 12 tasks

task 1, lines 6-25:
//# publish
Expand Down Expand Up @@ -49,60 +49,7 @@ task 10, line 43:
Epoch advanced: 2

task 11, lines 45-55:
//# run-graphql
Response: {
"data": {
"checkpoints": {
"nodes": [
{
"epoch": {
"epochId": 0
},
"sequenceNumber": 0
},
{
"epoch": {
"epochId": 0
},
"sequenceNumber": 1
},
{
"epoch": {
"epochId": 0
},
"sequenceNumber": 2
},
{
"epoch": {
"epochId": 1
},
"sequenceNumber": 3
},
{
"epoch": {
"epochId": 1
},
"sequenceNumber": 4
},
{
"epoch": {
"epochId": 2
},
"sequenceNumber": 5
},
{
"epoch": {
"epochId": 2
},
"sequenceNumber": 6
}
]
}
}
}

task 12, lines 58-68:
//# run-graphql --wait-for-checkpoint-pruned 0
//# run-graphql --wait-for-checkpoint-pruned 4
Response: {
"data": {
"checkpoints": {
Expand Down
15 changes: 1 addition & 14 deletions crates/sui-graphql-e2e-tests/tests/stable/prune.move
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,7 @@ module Test::M1 {

//# advance-epoch

//# run-graphql
{
checkpoints {
nodes {
epoch {
epochId
}
sequenceNumber
}
}
}


//# run-graphql --wait-for-checkpoint-pruned 0
//# run-graphql --wait-for-checkpoint-pruned 4
{
checkpoints {
nodes {
Expand Down

0 comments on commit 9912f6f

Please sign in to comment.