VS2010:VS2010 测试设置中的测试设置脚本出现问题

发布于 2024-09-25 10:07:44 字数 243 浏览 0 评论 0原文

在 VS2010 测试设置文件中,我指定了一个调用 powershell 脚本的 .bat 文件。从命令提示符运行 .bat 文件效果很好,并且 .bat 在不到 5 秒的时间内返回。但是,如果我尝试运行测试,运行最终会报告“未执行”结果,并报告错误“代理计算机 [machinename] 上的安装批处理文件超出了执行超时期限”(默认情况下为 100 秒)。我使用 VS2010 Ultimate 在本地运行测试(没有单独的控制器)。

有人遇到过这个吗?

In the VS2010 Test Settings file, I've specified a .bat file that invokes a powershell script. Running the .bat file from a command prompt works just fine and the .bat returns in less than 5 secs. However, if I try to run a test, the run eventually reports a 'not executed' result and reports an error "The setup batch file on agent machine [machinename] exceeded the execution timeout period" (which is 100s by default). I am running the test locally (no seperate controller) using VS2010 Ultimate.

Has anyone run into this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

望喜 2024-10-02 10:07:44

当安装脚本包含对 powershell.exe 的调用时,我能够重现测试执行失败并超时问题。正如此处,问题是 powershell.exe 在其输入流打开之前不会退出。

不过,我能够使用提到的解决方法这里(解决方法是使用空流作为 powershell.exe 的输入。)

powershell.exe dir < NUL

问候
阿西姆·班萨尔

I was able to reproduce the problem of test execution failing with exceeded timeout problem when the setup script contains call to powershell.exe. As mentioned here, the problem is that the powershell.exe does not exit until its input stream is open.

However I was able to make it working with the workaround mentioned here (The workaround is to use null stream as input for the powershell.exe.)

powershell.exe dir < NUL

Regards
Aseem Bansal

半﹌身腐败 2024-10-02 10:07:44

您只需在批处理文件中写入:

powershell.exe < NUL -executionpolicy unrestricted -file "yourfilename"

这也应该有效。

You can just write into your batch file:

powershell.exe < NUL -executionpolicy unrestricted -file "yourfilename"

That should also work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文