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

Fix race error of server package #1689

Merged
merged 6 commits into from
Jun 6, 2022
Merged

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Jun 3, 2022

Description:

WHAT

This PR contains the following changes.

  • I have fixed the use of error groups
    • The server package uses errgroup, but when errgroup.Get is used in the test case, a race condition occurs due to conflicts with other test functions.
  • I have deleted the duplicate test function
    • The original test name was incorrect, and a test was generated to test the same function, so it was deleted

WHY

A race error was occurring in the server package.

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.18.2
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 1.14.5

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jun 3, 2022

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@hlts2 hlts2 self-assigned this Jun 3, 2022
@hlts2 hlts2 requested review from kevindiu and vankichi June 3, 2022 16:10
@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #1689 (678e9a1) into master (626c706) will increase coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1689      +/-   ##
==========================================
+ Coverage   31.30%   31.35%   +0.05%     
==========================================
  Files         374      374              
  Lines       32591    32591              
==========================================
+ Hits        10203    10220      +17     
+ Misses      22003    21989      -14     
+ Partials      385      382       -3     
Impacted Files Coverage Δ
pkg/agent/core/ngt/service/option.go 89.57% <0.00%> (-1.85%) ⬇️
internal/worker/queue.go 98.73% <0.00%> (-1.27%) ⬇️
internal/core/algorithm/ngt/ngt.go 65.35% <0.00%> (+0.65%) ⬆️
internal/worker/worker.go 85.15% <0.00%> (+2.34%) ⬆️
...ent/core/ngt/service/vqueue/undeleted_index_map.go 76.66% <0.00%> (+8.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 528b937...678e9a1. Read the comment docs.

internal/servers/server/server_test.go Outdated Show resolved Hide resolved
internal/servers/servers_test.go Show resolved Hide resolved
internal/servers/server/server_test.go Outdated Show resolved Hide resolved
internal/servers/servers_test.go Outdated Show resolved Hide resolved
hlts2 added 2 commits June 6, 2022 10:45
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
vankichi
vankichi previously approved these changes Jun 6, 2022
Copy link
Contributor

@vankichi vankichi left a comment

Choose a reason for hiding this comment

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

Thanks :)

internal/servers/servers_test.go Outdated Show resolved Hide resolved
internal/servers/servers_test.go Outdated Show resolved Hide resolved
Co-authored-by: Kevin Diu <kevindiujp@gmail.com>
vankichi
vankichi previously approved these changes Jun 6, 2022
@hlts2 hlts2 requested a review from kmrmt June 6, 2022 02:21
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
internal/servers/server/server_test.go Outdated Show resolved Hide resolved
internal/servers/servers_test.go Show resolved Hide resolved
@kpango kpango merged commit bcaac99 into master Jun 6, 2022
@kpango kpango deleted the bugfix/internal/server/race-test branch June 6, 2022 04:36
@hlts2 hlts2 mentioned this pull request Jun 8, 2022
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.

6 participants