Skip to content

Tests: Fix t.Parallel() errors in gen package#4992

Closed
michaeldiamant wants to merge 4 commits into
masterfrom
parallelize_gen
Closed

Tests: Fix t.Parallel() errors in gen package#4992
michaeldiamant wants to merge 4 commits into
masterfrom
parallelize_gen

Conversation

@michaeldiamant
Copy link
Copy Markdown
Contributor

Enables https://github.com/kunwardeep/paralleltest on gen by fixing linter warnings. Incrementally moves the ball towards greater unit test parallelization, which reduces local + CI test durations.

I vetted for flakiness by running:

go test -race -count 10 ./gen/...

Notes:

  • The PR does not intend to rework all sequential tests into parallel tests. My objective is to enable already available parallelism throughout go-algorand. And then make a pass through remaining sequential tests to see if/where more parallelism exists.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 9, 2023

Codecov Report

Merging #4992 (906982b) into master (a688c23) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4992   +/-   ##
=======================================
  Coverage   53.44%   53.45%           
=======================================
  Files         431      431           
  Lines       54364    54364           
=======================================
+ Hits        29056    29060    +4     
+ Misses      23053    23048    -5     
- Partials     2255     2256    +1     
Impacted Files Coverage Δ
ledger/blockqueue.go 82.25% <0.00%> (-2.69%) ⬇️
ledger/tracker.go 74.26% <0.00%> (-0.85%) ⬇️
network/wsNetwork.go 65.16% <0.00%> (ø)
catchup/service.go 69.64% <0.00%> (+0.70%) ⬆️
network/wsPeer.go 67.81% <0.00%> (+1.83%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@michaeldiamant michaeldiamant marked this pull request as ready for review January 11, 2023 19:17
jdtzmn
jdtzmn previously approved these changes Jan 23, 2023
Copy link
Copy Markdown
Contributor

@jdtzmn jdtzmn left a comment

Choose a reason for hiding this comment

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

Looks good! I have confirmed locally that the go test command above passes and that all test files within the gen package are discovered correctly (connected to #5046).

I'm a bit confused why the data/bookkeeping package has changes, but since the changes look good I don't see any reason not to include them in this PR.

Comment thread gen/generate_test.go Outdated
} {
tc := tc
t.Run(fmt.Sprintf("name=%v", tc.name), func(t *testing.T) {
t.Parallel()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this subtest is not safe to parallelize (GenerateGenesisFiles) and I don't think it is worth trying to push parallelization all the way to this level

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a nolint comment to prevent parallelization for this entire test

@algochoi algochoi requested a review from cce February 15, 2023 15:49
@algochoi algochoi deleted the parallelize_gen branch June 28, 2023 19:08
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