VS2010:VS2010 测试设置中的测试设置脚本出现问题
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当安装脚本包含对 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
您只需在批处理文件中写入:
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.