Pytest 和 virtualenv ||无法配置容器:[Errno 1]

Pytest and virtualenv || Failed to configure container: [Errno 1]

我目前正在开发一个 python 程序,用于通过 运行 多次查找不稳定的测试。为了实现这个目标,我使用 pytest 在 vi​​rtualenv 中以随机顺序执行测试。

当我通过 slurm 作业在远程机器上执行程序时,出现以下错误代码:

2019-11-26 18:18:18,642 - CRITICAL - Failed to configure container: [Errno 1] Creating overlay mount for '/' failed: Operation not permitted. Please use other directory modes, for example '--read-only-dir /'.

2019-11-26 18:18:18,777 - CRITICAL - Cannot execute 'pytest': execution in container failed. 

这不会发生在我的本地机器上,只会发生在通过 slurm 作业启动的任务上。

这是我第一次在如此复杂的情况下使用 python,所以我不太确定从哪里开始解决问题。

提前致谢!

我终于发现问题只出现在最新版本的 benchexec.

当我的 python 程序在 virtualenv 中执行 运行 exec --no-container --pytest 并且 benchexec 是 2.0 或更高版本时,显示在我原来的 post 中的错误消息出现了。我只是告诉 pip 在我的 virtualenv 中安装旧版本的 benchexec,瞧,它可以工作了。

我本来可以创建标签 benchexec,但没有必要的学分。欢迎帮我做!