Skip to content

test(healthcheck): fix flaky tests by adding clean up operation in watch_test.go file #126

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

Merged
merged 2 commits into from
Oct 29, 2023

Conversation

longyue0521
Copy link
Contributor

进入/healthcheck目录

  1. 执行go test -race -failfast -timeout=0 -shuffle=on -count=1 .发现测试时而通过时而失败
    image
    分析原因——测试之间有数据依赖:
    使用-shuffle=on参数打乱了测试执行顺序——当先执行TestGetWatchers后执行TestWatch则导致TestWatch失败.
  2. 执行go test -race -failfast -timeout=0 -shuffle=on -count=100 -run=TestWatch
    image
    分析原因——测试不封闭缺少Clean up阶段,所以不能重复运行

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1536955) 85.54052% compared to head (d32b8ae) 85.63361%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main        #126         +/-   ##
===================================================
+ Coverage   85.54052%   85.63361%   +0.09309%     
===================================================
  Files            188         188                 
  Lines          16114       16114                 
===================================================
+ Hits           13784       13799         +15     
+ Misses          1771        1756         -15     
  Partials         559         559                 
Flag Coverage Δ
unittests 85.63361% <ø> (+0.09309%) ⬆️

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

see 5 files with indirect coverage changes

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

@sandyskies sandyskies merged commit c049a34 into trpc-group:main Oct 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2023
@longyue0521 longyue0521 deleted the fix_healthcheck branch October 29, 2023 04:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants