mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
triedb/pathdb: fix TestTruncateOutOfRange after graceful head truncation change (#573)
The streaming archival PR changed truncateFromHead to return nil (instead of an error) when nhead > ohead, gracefully handling unclean shutdowns where state history was not fully written. Update the test to expect nil for the head+1 case. Co-authored-by: tellabg <249254436+tellabg@users.noreply.github.com>
This commit is contained in:
parent
2ee9408be5
commit
34baa98ea9
1 changed files with 2 additions and 2 deletions
|
|
@ -244,8 +244,8 @@ func TestTruncateOutOfRange(t *testing.T) {
|
||||||
target uint64
|
target uint64
|
||||||
expErr error
|
expErr error
|
||||||
}{
|
}{
|
||||||
{0, head, nil}, // nothing to delete
|
{0, head, nil}, // nothing to delete
|
||||||
{0, head + 1, errHeadTruncationOutOfRange},
|
{0, head + 1, nil}, // gracefully handled after unclean shutdown
|
||||||
{0, tail - 1, errHeadTruncationOutOfRange},
|
{0, tail - 1, errHeadTruncationOutOfRange},
|
||||||
{1, tail, nil}, // nothing to delete
|
{1, tail, nil}, // nothing to delete
|
||||||
{1, head + 1, errTailTruncationOutOfRange},
|
{1, head + 1, errTailTruncationOutOfRange},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue