Windows 8 Appx installation timeout during unit test execution


  • This is basically a cross-post for my question on Stackoverflow (http://stackoverflow.com/questions/13162958/windows-8-appx-installation-timeout-during-unit-test-execution), so sorry about this. After looking into other win8 issues on stackoverflow, I thought it's not likely to get a prompt answer over there, so trying here instead. 

    The problem is that the unit tests for our Modern UI/Metro app fail randomly with an AppX installation timeout. This happens when executing the tests through the command line test runner vstest.console.exe on our CI environment. I have not seen this happen through Visual Studio, but then again I don't keep log files for each and every build I run and test set to execute. 

    Starting test execution, please wait...
    Error: Installation of package '\absolute\path\to\unittest.appx' 
    failed with Error: (0x5B4) Operation timed out. Unable to install Windows app package in 15 sec.
    For more details look into Event Viewer under Applications and Services Logs -> Microsoft -> Windows -> AppXDeployment-Server -> Microsoft-Windows-AppXDeploymentServer/Operational.

    When looking at the logs, as suggested above, the package does seem to install after roughly 30-45seconds, but since the foreground process already failed, we have no way of knowing of the success. 

    This happens quite randomly, and there can be several builds when we don't see this problem. This seems to be some form of race condition issue, but the root cause is unknown. Is there a way to either increase the installation timeout for vstest.console.exe or prevent the timeout from happening by checking (and waiting) for some condition to be true before proceeding with the installation? 

    Our environment: Win8 release, Visual Studio 2012, C# Metro style app, VS test runner, powershell

    Thursday, November 1, 2012 8:58 AM