c# - [C#]:等待任务完成时达到 600 秒的最大超时
问题描述
在我的测试中,我有一个for循环,它运行一个 powershell 脚本,有时需要更长的时间来执行。我遇到了这样的错误:在等待任务完成时达到了 600 秒的最大超时。我想问一下,这个错误是否发生在整个测试需要超过 600 秒才能完成或一个脚本运行时间超过 600 秒?
PS我从命令行运行该测试
这会对我有帮助吗?如果不是,我应该改变什么?
process.WaitForExit(1000 * 60 * 60); //Wait up to one hour
编辑(整个例外):
等待任务完成时达到最大超时 600 秒:C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe "C:\Tests\resources\test_scripts\api-tests-hd \Installers\Test1\bin\Release\Test1.dll" /xml:"C:\Tests\Results\Test1\39.xml"。2018-05-17 06:49:01,933 错误 StarterConsole.HttpPost - FileNotFoundException 在 HttpUploadFile 中写入 fileStream 到 dataStream!System.IO.FileNotFoundException:找不到文件“C:\Tests\Results\Test1\39.xml”。文件名:System.IO.__Error.WinIOError 处的“C:\Tests\Results\Test1\39.xml”(Int32 errorCode,String maybeFullPath)
在 System.IO.FileStream.Init(字符串路径、FileMode 模式、FileAccess 访问、Int32 权限、Boolean useRights、FileShare 共享、Int32 bufferSize、FileOptions 选项、SECURITY_ATTRIBUTES secAttrs、String msgPath、Boolean bFromProxy、Boolean useLongPath、Boolean checkHost)
在 System C 中 StarterConsole.HttpPost.HttpUploadFile(Uri postLocation, String file, String paramName, String contentType, Dictionary`2 postItems, Int32 retries) 的 .IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share): \repos\starterconsole\StarterConsole\Http\HttpPost.cs:第 293 行
解决方案
推荐阅读
- c# - 创建用于在远程位置记录的自定义日志附加器
- linux-kernel - Linux 设备驱动程序:没有为具有地址的兼容设备调用探测函数
- html - HTML / CSS试图将输入文本框移动到设定位置
- javascript - 将每个 Li 元素转换为对象
- javascript - React state 根据日期和时间组织状态
- python - 使用 PILLOW [PIL, Python] 将透视校正图像与透明背景模板图像合并
- apache-spark - Spark 动态分区:读取时出现 SchemaColumnConvertNotSupportedException
- stripe-payments - Stripe Connect 从服务器创建帐户
- java - 带有 JPA @MappedSuperclass 的类使用大量内存
- checkout - 无法在 ClearCase Explorer 中签出具有长名称的文件