Skip to content

feat[utest]: repeat the automatic run and sample free/ps between loops - #11983

Open
sexenteen wants to merge 1 commit into
RT-Thread:masterfrom
sexenteen:feat/utest-auto-run-loop
Open

sexenteen wants to merge 1 commit into
RT-Thread:masterfrom
sexenteen:feat/utest-auto-run-loop

Conversation

@sexenteen

@sexenteen sexenteen commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • Use workflow from 保持默认分支(通常为 master)
    Keep the default branch (usually master) in Use workflow from
  • 在 branch 输入框填写 PR 分支 feat/utest-auto-run-loop
    Enter PR branch feat/utest-auto-run-loop in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 feat/utest-auto-run-loop 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the feat/utest-auto-run-loop branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: components

Reviewers: @Maihuanyi

Changed Files (Click to expand)
  • components/utilities/Kconfig
  • components/utilities/utest/utest.c

🏷️ Tag: workflow

Reviewers: @Rbb666 @kurisaW @supperthomas

Changed Files (Click to expand)
  • .github/workflows/utest_auto_run.yml

📊 Current Review Status (Last Updated: 2026-11-04 12:29 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

@sexenteen
sexenteen force-pushed the feat/utest-auto-run-loop branch from d0443b1 to edc2ec4 Compare November 3, 2026 16:02
@Rbb666

Rbb666 commented Nov 4, 2026

Copy link
Copy Markdown
Member

建议先改这几处:

  1. timeout-minutes 里的 * 20 不支持,Actions 表达式不能做乘法。放到前置 Bash 步骤计算,再通过 output 引用。
  2. CI 看到第一轮 finished 就退出了,后续轮次和 free/ps 都会漏掉。建议在全部循环及采样结束后增加 all loops finished 标记,CI 等这个标记再判断结果,并保留各轮的失败状态。
  3. 脚本内部还有写死的 timeout 20m,需要一起调整。循环次数也应先校验为 1~100 的整数。

改完补测一下“第一轮成功、第二轮失败”的情况,确认 CI 会报失败,每轮资源采样也能完整输出。

@sexenteen
sexenteen force-pushed the feat/utest-auto-run-loop branch from edc2ec4 to 7d5ff81 Compare November 4, 2026 04:09
@sexenteen
sexenteen force-pushed the feat/utest-auto-run-loop branch from 7d5ff81 to 9a5981d Compare November 4, 2026 04:29
@sexenteen

Copy link
Copy Markdown
Contributor Author

@Rbb666 两条都改了(commit 9a5981d9):

1. timeout-minutes 不能用表达式 —— 确认了,之前的写法会让整个工作流变成"无效文件"(GitHub 生成一个
名字是文件路径、0 个 job 的失败运行)。现在 step 级改回字面量 360,真正的时间上限挪到 bash 里算:

LOOP_NUM="${UTEST_LOOP:-1}"
case "$LOOP_NUM" in ''|*[!0-9]*) LOOP_NUM=1 ;; esac
MONITOR_TIMEOUT_MIN=$(( LOOP_NUM * 20 ))
timeout "${MONITOR_TIMEOUT_MIN}m" bash -c '...'

没有走 job output 引用,是因为这个值只在 monitor 这一步用到,在同一个 shell 里算更省事;如果你更希望用
outputs 传,我再改。

2. CI 看到第一轮 finished 就退出 —— 这个确实是 bug,已按你的思路修:utest_do_run() 在所有循环
和每轮采样都结束后,再打印一次

[==========] [ utest    ] all loops finished

CI 改成等这一行再判断结果。实测 utest_loop=3 时的顺序是:三轮 finished + 三轮 runtime info,
最后才出现一次 all loops finished。

修复后重新跑,utest_auto_run 已恢复成正常的 43 个 job(run #5078)。

另外本地复核:loop=1 行为不变(1 轮、无 runtime info 输出);loop=3 三轮 used 都是 42888。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action github action yml imporve Component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants