简体   繁体   中英

Jenkins job does not execute on slave until user logs into the slave virtual machine

Setup:

  1. Master is on Windows VM "A"
  2. Slave is on Windows VM "B"
  3. Slave connects to master using java -jar agent.jar -jnlpUrl http://path/to/this/slave-agent.jnlp -secret thisisasecret -workDir "C:\\my-work-dir"
  4. The Jenkins Job executes a batch command. The command runs Nunit console, which executes selenium tests

The Job that I'm executing is a selenium script, which opens a chrome instance on "B"

This is what I'm doing when it works:

  1. Log into "B" using windows RDP
  2. Open jenkins and trigger the selenium Job
  3. I can see the Job executing on "B" and completes with no issues in about 4 minutes

This is when it DOES NOT work:

  1. I DO NOT log into "B"
  2. Open jenkins and trigger the selenium Job
  3. Jenkins interface shows that the Job is executing but it runs indefinitely

Now if I log into "B" while the job is still running, as soon as I log in, I can see the chromedriver cmd appear and a chrome instance is brought up and the job is run and completes with no issues.

Does anybody know what could be causing this? Thanks!

We had tests that passed only when I was logged on the machine. Turned out that the test needed interactive desktop. In order to keep the session, you can make a bat file that you can use when you logout of the machine in order to keep the session interactive.

tscon %sessionname% /dest:console

Reference:
https://www.automatetheplanet.com/visual-studio-test-agents-cleaning-scripts/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM