Repository navigation
Commit c012a8a
authored
tests: don't panic when a staker query fails during a wait (#146)
waitForCompletedPeriods logged periodDetails.CompletedPeriods before
checking the query error, so a failed GetValidationPeriodDetails call
dereferenced a nil result and panicked. The panic skipped RunFlakyTest's
retries and hid the query error. It failed thor-private CI twice in
Test_Stargate_DelegatorFlow_Stake_And_Claim_Auto_Renew_On_And_Off while
the chain was producing blocks normally.
Check the error first. A failed query now counts as not done yet, is
logged, and polling continues within the existing one-minute bound. If
the wait still fails, return the underlying error instead of a generic
StakerStatusUnknownError, so the cause shows and the test is retried.
assertValidatorStatus and assertValidatorStatusUnknown in the
validations tests had the same nil dereference after assert.NoError:
stop with require.NoError, or return the error for a retry.1 parent d65070a commit c012a8a
2 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
47 | | - | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
772 | 773 | | |
773 | 774 | | |
774 | 775 | | |
775 | | - | |
| 776 | + | |
776 | 777 | | |
777 | 778 | | |
778 | 779 | | |
779 | 780 | | |
780 | 781 | | |
781 | 782 | | |
782 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
| |||
0 commit comments