Skip to content

test: use WaitGroup.Go to simplify code#3239

Merged
julienrbrt merged 1 commit intoevstack:mainfrom
stringsbuilder:main
Apr 13, 2026
Merged

test: use WaitGroup.Go to simplify code#3239
julienrbrt merged 1 commit intoevstack:mainfrom
stringsbuilder:main

Conversation

@stringsbuilder
Copy link
Copy Markdown
Contributor

@stringsbuilder stringsbuilder commented Apr 12, 2026

Overview

use WaitGroup.Go to simplify code. More info: golang/go#63796

Summary by CodeRabbit

  • Tests
    • Simplified internal test implementation patterns for improved code maintainability.

Note: This release contains no user-facing changes. Updates are limited to internal test infrastructure improvements.

Signed-off-by: stringsbuilder <stringsbuilder@outlook.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

A test goroutine launching pattern was simplified in TestSyncerStatusStartOnce. The manual wg.Add(1) plus explicit go func() with defer wg.Done() pattern was replaced with direct wg.Go() calls. The underlying concurrent execution and synchronization logic remains unchanged.

Changes

Cohort / File(s) Summary
Goroutine Pattern Refactoring
pkg/sync/syncer_status_test.go
Simplified goroutine launching in test by replacing manual wg.Add(1) and defer wg.Done() pattern with wg.Go() method calls. Concurrent execution body and error handling remain functionally identical.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A hop through the Go-wait groups with grace,
No more manual adds cluttering the place,
wg.Go() now flows like morning dew,
Cleaner patterns make tests shine anew!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description provides a brief explanation and references a Go issue for context, but lacks detail about the specific changes, motivation, and testing. Expand the description to explain why WaitGroup.Go is preferred, what benefits it provides, and confirm testing was performed on the refactored code.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: refactoring test code to use WaitGroup.Go for simpler concurrent logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.79%. Comparing base (6f8e093) to head (571f381).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3239      +/-   ##
==========================================
- Coverage   61.81%   61.79%   -0.02%     
==========================================
  Files         120      120              
  Lines       12670    12670              
==========================================
- Hits         7832     7830       -2     
- Misses       3960     3962       +2     
  Partials      878      878              
Flag Coverage Δ
combined 61.79% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@julienrbrt julienrbrt changed the title refactor: use WaitGroup.Go to simplify code test: use WaitGroup.Go to simplify code Apr 13, 2026
@julienrbrt julienrbrt enabled auto-merge April 13, 2026 09:37
@julienrbrt julienrbrt added this pull request to the merge queue Apr 13, 2026
Merged via the queue into evstack:main with commit 5f8e820 Apr 13, 2026
39 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants