Skip to content
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

tx indexer fix: avoids using sleep in test #1151

Merged
merged 8 commits into from
Apr 17, 2024

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Apr 15, 2024

I think we can wait for the eventually to pass before closing the chain to avoid adding a sleep

@darioush darioush changed the title fix unindexor in state sync avoids using sleep in test Apr 15, 2024
@darioush darioush changed the title avoids using sleep in test tx indexer fix: avoids using sleep in test Apr 15, 2024
@@ -483,6 +484,7 @@ func (bc *BlockChain) maintainTxIndex() {
if head := bc.CurrentBlock(); head != nil && head.Number.Uint64() > txLookupLimit {
done = make(chan struct{})
tail := rawdb.ReadTxIndexTail(bc.db)
bc.wg.Add(1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively I think we can check if done != nil { ... } like its done in bc.quit, but also wg seems fine.

@darioush darioush marked this pull request as ready for review April 16, 2024 18:27
@darioush darioush requested a review from ceyonur as a code owner April 16, 2024 18:27
core/blockchain.go Outdated Show resolved Hide resolved
core/blockchain.go Outdated Show resolved Hide resolved
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
core/blockchain.go Outdated Show resolved Hide resolved
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
@ceyonur ceyonur merged commit 26e6a34 into tx-indexing-fix Apr 17, 2024
7 checks passed
@ceyonur ceyonur deleted the tx-indexing-fix-nosleep branch April 17, 2024 12:26
ceyonur added a commit that referenced this pull request Apr 17, 2024
* fix unindexor in state sync

* fix lint

* fix flaky test

* Update core/blockchain_test.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* Update core/test_blockchain.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* fix reviews

* readd delay for index init

* Update core/rawdb/accessors_state_sync.go

Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>

* tx indexer fix: avoids using sleep in test (#1151)

* avoids using sleep in test

* track all goroutines

* trying harder

* add some debug information in case of fail

* Update core/blockchain.go

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

* Update core/blockchain.go

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

---------

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>

---------

Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants