Skip to content

Add concurrent-use guard to InitTestLog#4584

Open
joshuacolvin0 wants to merge 1 commit intomasterfrom
fix-inittestlog-parallel-guard
Open

Add concurrent-use guard to InitTestLog#4584
joshuacolvin0 wants to merge 1 commit intomasterfrom
fix-inittestlog-parallel-guard

Conversation

@joshuacolvin0
Copy link
Copy Markdown
Member

Add a TryLock guard to InitTestLog that fatals if called concurrently,
since it mutates the global logger. Add t.Helper() for better error
attribution. Disable parallel mode on tests that use InitTestLog for
log assertions, and remove an unnecessary InitTestLog call from
TestTrieDBCommitRace that discarded the handler.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Add a TryLock guard to InitTestLog that fatals if called concurrently,
since it mutates the global logger. Add t.Helper() for better error
attribution. Disable parallel mode on tests that use InitTestLog for
log assertions, and remove an unnecessary InitTestLog call from
TestTrieDBCommitRace that discarded the handler.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.31%. Comparing base (c4de738) to head (5daab3f).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4584      +/-   ##
==========================================
+ Coverage   34.22%   34.31%   +0.09%     
==========================================
  Files         498      498              
  Lines       59094    59098       +4     
==========================================
+ Hits        20223    20279      +56     
+ Misses      35293    35232      -61     
- Partials     3578     3587       +9     

@github-actions
Copy link
Copy Markdown
Contributor

❌ 13 Tests Failed:

Tests completed Failed Passed Skipped
4692 13 4679 0
View the top 3 failed tests by shortest run time
TestPruningDBSizeReduction
Stack Traces | 0.000s run time
=== RUN   TestPruningDBSizeReduction
--- FAIL: TestPruningDBSizeReduction (0.00s)
TestAliasingFlaky
Stack Traces | -0.000s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
=== PAUSE TestAliasingFlaky
=== CONT  TestAliasingFlaky
    common_test.go:777: BuildL1 deployConfig: DeployBold=true, DeployReferenceDAContracts=false
INFO [03-31|01:06:10.955] Submitted contract creation              hash=0x399184f9977f0f6ea1e1f807698efdd88b4fcbb85106214486ecbfdf28b60683 from=0x57Ff0F473737a1c161bfF9efDF016F7991585088 nonce=0  contract=0xA46C59ce2FCaF445F96f66F0411e06A94D34BF45 value=0
WARN [03-31|01:06:10.955] Served eth_getTransactionReceipt         reqid=7 duration="21.089µs" err="transaction indexing is in progress" errdata="\"transaction indexing is in progress\""
INFO [03-31|01:06:10.956] Starting work on payload                 id=0x0324f80dd0c6487e
INFO [03-31|01:06:10.956] Updated payload                          id=0x0324f80dd0c6487e                      number=1 hash=71311b..56ab91 txs=1  withdrawals=0 gas=854,353 fees=8.54353e-07 root=b91864..dddedf elapsed="290.487µs"
INFO [03-31|01:06:10.956] Stopping work on payload                 id=0x0324f80dd0c6487e                      reason=delivery
INFO [03-31|01:06:10.956] Imported new potential chain segment     number=1 hash=71311b..56ab91 blocks=1  txs=1  mgas=0.854 elapsed="526.504µs" mgasps=1622.690 triediffs=3.08KiB triedirty=0.00B
INFO [03-31|01:06:10.957] Chain head was updated                   number=1 hash=71311b..56ab91 root=b91864..dddedf elapsed="104.115µs"
INFO [03-31|01:06:10.957] Indexed transactions                     blocks=2  txs=1  tail=0 elapsed="83.104µs"
INFO [03-31|01:06:10.958] Starting peer-to-peer node               instance=test-stack-name/linux-amd64/go1.25.8
WARN [03-31|01:06:10.958] P2P server will be useless, neither dialing nor listening
INFO [03-31|01:06:10.958] Deploying rollup creator
INFO [03-31|01:06:10.958] Deploying bridge creator contracts
INFO [03-31|01:06:10.958] Deploying bridge template
INFO [03-31|01:06:10.959] New local node record                    seq=1,774,919,170,959 id=8d47dfaebec96c3e                        ip=127.0.0.1 udp=0 tcp=0
INFO [03-31|01:06:10.960] Started P2P networking                   self=enode://c5fe882ab703b3d34ff4e4155b80be15af70925cc65f6a5d119e7de7c5ee584c4753b5899025ef5eaf30bda673eaf536621e3d44a71c14a03d6e0d0ae0deeda5@127.0.0.1:0
INFO [03-31|01:06:10.960] Started log indexer
WARN [03-31|01:06:10.960] Getting file info                        dir= error="stat : no such file or directory"
TestBatchPosterL1SurplusMatchesBatchGasFlaky
Stack Traces | 0.550s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x207b292]

goroutine 11 [running]:
testing.tRunner.func1.2({0x37e0920, 0x61f49b0})
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1872 +0x237
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1875 +0x35b
panic({0x37e0920?, 0x61f49b0?})
	/opt/hostedtoolcache/go/1.25.8/x64/src/runtime/panic.go:783 +0x132
github.com/offchainlabs/nitro/arbnode.(*InboxTracker).GetBatchCount(0x476b900?)
	/home/runner/work/nitro/nitro/arbnode/inbox_tracker.go:210 +0x12
github.com/offchainlabs/nitro/arbnode.(*InboxTracker).FindInboxBatchContainingMessage(0x0, 0x7)
	/home/runner/work/nitro/nitro/arbnode/inbox_tracker.go:225 +0x2f
github.com/offchainlabs/nitro/system_tests.TestBatchPosterL1SurplusMatchesBatchGasFlaky(0xc00054aa80)
	/home/runner/work/nitro/nitro/system_tests/batch_poster_test.go:839 +0x725
testing.tRunner(0xc00054aa80, 0x41b26f8)
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1934 +0xea
created by testing.(*T).Run in goroutine 1
	/opt/hostedtoolcache/go/1.25.8/x64/src/testing/testing.go:1997 +0x465

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link
Copy Markdown
Contributor

@bragaigor bragaigor left a comment

Choose a reason for hiding this comment

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

LGTM

@joshuacolvin0 joshuacolvin0 assigned eljobe and unassigned joshuacolvin0 Apr 1, 2026
@eljobe eljobe enabled auto-merge April 2, 2026 08:48
@eljobe eljobe added this pull request to the merge queue Apr 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants