POC测试中CPUBench时间报错处理

POC测试中CPUBench时间报错处理

Poc测试中CPUBench遇到System time is earlier than the release time of CPUBench-1.2.0, It will cause some workload failed to build, Please update system time.报错问题处理

图片[1]|POC测试中CPUBench时间报错处理|安可通用设备资源站

在arm架构服务器poc测试中,有可能会遇到System time is earlier than the release time of CPUBench-1.2.0, It will cause some workload failed to build, Please update system time.报错,翻译:系统时间早于CPUBench-1.2.0的发布时间,这将导致部分工作负载构建失败,请更新系统时间。

然而,系统时间已经最新

图片[2]|POC测试中CPUBench时间报错处理|安可通用设备资源站

我们在 framework/cpubench.py脚本中找到了 initial_cpubench_env()函数

version_package_time = os.stat(version_txt).st_mtime  # 获取 version.txt 文件的最后修改时间
now = time.time()  # 获取当前系统时间
if now < version_package_time:  # 如果当前系统时间早于文件的修改时间
    log.error("System time is earlier than the release time of CPUBench-{}, It will cause some workload failed to build, Please update system time.".format(GlobalVar.version))
    return ErrorCode.INITENV_FAIL

这里定义了以version.txt 文件的最后修改时间来作为最后版本时间,我们可以尝试:

  • ​备份原始文件​​(可选,但是好习惯):
cp /home/CPUBench/version.txt /home/CPUBench/version.txt.bak
  • 使用 touch命令修改文件时间戳​​:
# 将 version.txt 的修改时间设置为一个未来的时间,例如 2025年1月1日
touch -t 202501010000 /home/CPUBench/version.txt

-t参数后面跟的时间格式是 [[CC]YY]MMDDhhmm[.ss](年月日时分.秒)

  • ​验证时间是否修改成功​​:
ls -l /home/CPUBench/version.txt  # 查看新的修改时间
  • 重新运行 CPUBench​​:
./cpubench.sh -c config-test.ini
图片[3]|POC测试中CPUBench时间报错处理|安可通用设备资源站

成功!

© 版权声明
THE END
喜欢就支持一下吧
点赞65赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容