Forum Discussion

Rhendriks1's avatar
Rhendriks1
New Contributor
6 years ago

Starting Testexecute with powershell hanging process windows update 1803

Hey,

I encounter a problem using testexecute after an update of windows

Problem:

The process TestExeute.exe keeps runnning after the test has finished.

The powershell script that is waiting for the process to finish never continues and gets stuck.

 

The test is started on a windows 10 (build 17134) machine with TestExecute 11 on it using the following command:

Start-Process "C:\Program Files (x86)\SmartBear\TestExecute 11\Bin\TestExecute.exe" -ArgumentList '"C:\PAthToTestPRoject\TestProject TEST.pjs" /project:"TestProject TEST" /test:"Script|TestCentrum|TestCentrum_Main" /r  /e /SilentMode /ForceConversion'

 

This script has worked until we installed the windows update 1803.

After rebooting the virtual machine and starting an instance of testcomplete or testexecute a edge browser would start.

I followed the advice on the forum to not enable support for microsoft store apps.

the Edge browser didn't start anymore but the TestExecute process still didn't always close at the end of the test.

 

What I have found so far:

I found a process cftmon.exe that when I analyse the wait chain it's waiting for the testeExecute proces.

in the testexecute proces it says it's waiting for cftmon.exe.

when I kill the cftmon.exe process it restarts immidiatly and the testexecute process is closed.

 

 

 

 

7 Replies

  • Rhendriks1's avatar
    Rhendriks1
    New Contributor

    Hey,

    Problem:

    The process TestExeute.exe keeps runnning after the test has finished.

    The powershell script that is waiting for the process to finish never continues and gets stuck.

     

    The test is started on a windows 10 (build 17134) machine with TestExecute 11 on it using the following command:

    Start-Process "C:\Program Files (x86)\SmartBear\TestExecute 11\Bin\TestExecute.exe" -ArgumentList '"C:\testprojectPath\TestProject TEST.pjs" /project:"TestProject TEST" /test:"Script|TestCentrum|TestCentrum_Main" /r /e /SilentMode /ForceConversion'

     

    This script has worked until we installed the windows update 1803.

    After rebooting the virtual machine and starting an instance of testcomplete or testexecute a edge browser would start.

    I followed the advice on the forum to not enable support for microsoft store apps.

    the Edge browser didn't start anymore but the TestExecute process still didn't close at the end of the test.

     

    This would happen sometimes, there have been times that I was able to interupt the test and it would close the process.

     

    What I have found so far:

    I found a process CFTmon.exe that when I analyse the whaitchain says it's waiting for the testeExecute proces.

     

    in the testexecute proces it says it's waiting for CFTmon.exe.

    when I kill the CFTmon.exe process it restarts immidiatly and the testexecute process is closed.

     

    I hope I was clear in my explanation any help would be appreciated.

     

    greetings,

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        I can say nothing about TestExecute as I was not using it for some time, but I can confirm that I am observing sporadic cases when TestComplete 12.60 does not exit after the project is closed. No extra CPU or memory consumption. This started to happen after some latest Windows updates and seems to be related to Edge and, maybe, some other applications like Settings, etc.

        There were no problems with TC 12.60 Beta with no updates installed, so I think that this is some collision between TestComplete and the changes provided by Windows updates starting, approximately, from mid-August.

         

  • cunderw's avatar
    cunderw
    Community Hero

    Not sure if this will help with the latest windows update, but you might try something similar to how we run TE from powershell.

     

    function closeTestExecute() {
    	$testExecute = Get-Process TestExecute -ErrorAction SilentlyContinue
    	if ($testExecute) {
    		# try gracefully first
    		$testExecute.CloseMainWindow()
    		# kill after five seconds
    		Sleep 5
    		if (!$testExecute.HasExited) {
    			$testExecute | Stop-Process -Force
    		}
    	}
    	Remove-Variable testExecute
    }
    closeTestExecute
    ...
    ...
    ...
    $arg1 = "/r"
    $arg2 = "/project:$projectName"
    $arg3 = "/SilentMode"
    $arg4 = "/e"
    $arg5 = "/DoNotShowLog"
    $arg6 = "/Timeout 7200"
    $AllArgs = @($NextTest, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6)
    & "C:\Program Files (x86)\SmartBear\TestExecute 12\x64\Bin\TestExecute.exe" $AllArgs | Out-Null
    • Rhendriks1's avatar
      Rhendriks1
      New Contributor

      Hey Carson,

       

      Thanks for your quick reply.

      So the issue is not that I cannot close the process, I could close it through powershell at any time.

      ussually the machine would pick up the next test once it notices that the TestExecute has finished by for example using:

      $processId = start-proces  "C:\Program Files (x86)\SmartBear\TestExecute 12\x64\Bin\TestExecute.exe" $AllArgs -PassThru

      $processId .WaitForExit()

       

      or

      polling every 60 seconds on the procces name of TestExecute and when it doesn't exist anymore starting up the next test.

      So the main problem is how to decide when the test is finished if the process doesn't end after running the test.

       

      The timeout parameter could help but the playtimes of the test are variable, and I'm not sure if it would close the program I'll have to try it out.

      I cannont find the Donotshowlog parameter in the Testcomplete command line documentation. But the show log at the end of the test is disabled in the project settings. https://support.smartbear.com/testcomplete/docs/working-with/automating/command-line-and-exit-codes/command-line.html

       

      But I think I might still be unclear in what the problem exactly is, I'll try to find a virtual machine where it happens tomorrow and have more screenshots of how TestExecute 11 seems to start closing down and uses very little memory in comparison to when it's runnning the test and then doesn't close down.

       

      A solution I tried out was restarting the ctfmon process every half an hour so I wouldn't have to check which seemed more like a hack than a solution.

       

      If I misunderstood your answer further explanation would be helpful.

       

      greetings and thanks again,

       

      RHendriks

      • cunderw's avatar
        cunderw
        Community Hero

        Ah ok, I see what you're saying now, you're never getting an exit code for it. This is likely something to do specifically with the latest update of windows. Do you see this in the latest version of test execute? You might need to talk directly with support on this. Definitely seems like a bug.