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(task_manager.h): 首次tick超时任务没有重置 #46

Merged
merged 4 commits into from
Apr 3, 2023
Merged

Conversation

vbirds
Copy link
Contributor

@vbirds vbirds commented Mar 30, 2023

首次tick,task_timeout_timer_里的超时任务没有重置

首次tick,task_timeout_timer_里的超时任务没有重置
@owent
Copy link
Owner

owent commented Mar 30, 2023

感谢修复,可否也修复一下单元测试和下面 C++20 协程的相同问题(1310行)?
或者仅修复一下单元测试,C++20协程的相同BUG我自己晚点来也行。
之前单元测试也是有问题的,导致没检测出来。

C++20 task_mgr 超时任务重置,单元测试修改。
@vbirds
Copy link
Contributor Author

vbirds commented Mar 30, 2023

感谢修复,可否也修复一下单元测试和下面 C++20 协程的相同问题(1310行)? 或者仅修复一下单元测试,C++20协程的相同BUG我自己晚点来也行。 之前单元测试也是有问题的,导致没检测出来。

提交了,韬哥帮review下代码

之前提交的检查task 超时的单元测试有误,修复提交下
@vbirds vbirds requested a review from owent March 31, 2023 02:38
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (3302f3e) 89.78% compared to head (8d460d9) 89.83%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##               v2      #46      +/-   ##
==========================================
+ Coverage   89.78%   89.83%   +0.04%     
==========================================
  Files          36       36              
  Lines        2761     2773      +12     
==========================================
+ Hits         2479     2491      +12     
  Misses        282      282              
Impacted Files Coverage Δ
include/libcotask/task_manager.h 87.64% <100.00%> (+0.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

CASE_EXPECT_EQ(1, (int)task_mgr->get_task_size());
CASE_EXPECT_EQ(0, (int)task_mgr->get_tick_checkpoint_size());
CASE_EXPECT_EQ(0, (int)task_mgr->get_checkpoints().size());
// tick reset timeout: 3 + 5 = 8
Copy link
Owner

Choose a reason for hiding this comment

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

task_mgr->tick(8); 还是需要保留哈,这是用来确保tick(8)的时候定时器还没有执行删除的。

单元测试加回  task_mgr->tick(8);
@vbirds vbirds requested a review from owent March 31, 2023 07:10
@owent owent merged commit 69ed252 into owent:v2 Apr 3, 2023
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.

3 participants