celestiaorg / celestiaorg/celestia-node

flaky: TestSubmitFromCustomAccount in state

Open
#5,231 0 comments 0 reactions 1 assignee Claimed by @rootulp View on GitHub
bug
Dominant language
Go
Stars
996
Forks
1.1k
Avg merge
1d 6h
Merged PRs (30d)
34

Description

## Flaky test

**Test:** `TestSubmitFromCustomAccount`
**Package:** `github.com/celestiaorg/celestia-node/state`
**Seen on:** [#5230](https://github.com/celestiaorg/celestia-node/pull/5230) (a go.mod/go.sum-only nmt version bump)
**CI run:** https://github.com/celestiaorg/celestia-node/actions/runs/34488922210/job/102910298692

### Error

```
--- FAIL: TestSubmitFromCustomAccount (4.42s)
core_access_test.go:501:
Error Trace: /home/runner/work/celestia-node/celestia-node/state/core_access_test.go:501
Error: Should be true
Test: TestSubmitFromCustomAccount
network.go:74: tearing down testnode
network.go:115: error when closing API server close tcp 127.0.0.1:20594: use of closed network connection
FAIL github.com/celestiaorg/celestia-node/state 43.357s
```

### Notes

This looks like a flake rather than a real regression:

- #5230 changes only `go.mod` and `go.sum` — it does not touch `state/` at all.
- `Unit Tests (ubuntu-latest)` and `Unit Tests (macos-14)` both passed on the same commit; only the `Coverage` job failed.

The failing assertion at [`state/core_access_test.go:501`](https://github.com/celestiaorg/celestia-node/blob/main/state/core_access_test.go#L501) is

```go
require.True(t, updatedBalNonDefault.Amount.LT(balNonDefault.Amount))
```

i.e. a balance read taken immediately after `SubmitPayForBlob` returns. There is no wait for the balance query to be served at a height that includes the submitted tx, so the read can observe pre-tx state and the `LT` comparison fails. The neighbouring default-account assertion has the same shape.

A fix would be to poll the balance until it reflects the tx (with a bounded timeout) rather than asserting on a single immediate read.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.