This is the code I want to launch with Jenkins :
start cmd.exe /k "node "C:\Program Files\Appium\node_modules\appium\bin\appium.js" -a 127.0.0.1 -p 4723" ping 127.0.0.1 -n 30 > nul C:\path\NUnit-2.6.4\NUnit-2.6.4\bin\nunit-console.exe C:\path\NUnit-2.6.4\NUnit-2.6.4\bin\apk\UnitTestProject1.dll
This is the error I get every time I try to put a pause:
"ERROR: Input redirection is not supported, exiting the process immediately."
Same error with timeout /T 60
and sleep 60
According to this post , timeout does not work in non-interactive scripts.
How can I add a pause in my situation ?
Edit for Will Ryan :
I try this :
The build worked, but the test duration is only 0.5 seconds, the pause doesn't do anything
The console output is :
C:\Program Files\Jenkins\jobs\ZFAIL\workspace>echo "--" "--" C:\Program Files\Jenkins\jobs\ZFAIL\workspace>PING 1.1.1.1 -n 1 -w 30000 1>NUL C:\Program Files\Jenkins\jobs\ZFAIL\workspace>echo "++" "++" C:\Program Files\Jenkins\jobs\ZFAIL\workspace>exit 0 Finished: SUCCESS
Timeout with the parameter /NOBREAK If we take the example from before and run that in a BATCH file: timeout /t 60 then while waiting those 60 seconds, you are actually able to break the timeout by pressing any key on your keyboard. To prevent this we simply add the parameter /NOBREAK to the end of it.
You can insert the pause command before a section of the batch file that you might not want to process. When pause suspends processing of the batch program, you can press CTRL+C and then press Y to stop the batch program.
Type in your command.TIMEOUT — Type timeout time where "time" is replaced by the number of seconds to delay. For example, typing in timeout 30 will delay your batch file for 30 seconds.
The correct way to sleep in a batch file is to use the timeout command, introduced in Windows 2000.
I think you can use the following command in Execute Windows batch command (will wait for 100 seconds):
waitfor SomethingThatIsNeverHappening /t 100
This will return an error which could break your build. To avoid that, redirect the error output:
waitfor SomethingThatIsNeverHappening /t 100 2>NUL
You can use this:
PING 1.1.1.1 -n 1 -w 30000 >NUL
This send one ping attempt and waits 30 seconds for a response. Not sure why you're getting the "ERROR: Input redirection is not supported, exiting the process immediately." message but I actively use the command above regularly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With