Junit fails because the Server$StartJob still running - eclipse

I am running junit test on eclipse, all it does is, trying to start the server in debug mode. However, I am getting the following error:
"Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.wst.server.core.internal.Server$StartJob "
there is a piece of code that is triggered from a thread and it wont hit unless the junit tests are all complete. but once the tests are done, it closes the workbench and hence server startup job is never completed.
Is there a way to wait for the job to complete and then run junit test ?

Join their family to make the executing thread block until all jobs in the family are done.
See org.eclipse.core.runtime.jobs.IJobManager#join(Object, IProgressMonitor) and
org.eclipse.wst.server.core.ServerUtil#SERVER_JOB_FAMILY

Related

Avoid stopping of Julia for REST service

I try to build a little REST service with Julia and Genie library. The last command is up(8888).
When I start this from Julia REPL all is ok.
When I start it from command line like >julia myrestapi.jl the program starts and stops immediately, i.e. up() doesn't go into an infinite loop.
What can I do to keep the server running?
When the Genie server is initiated in asynchronous mode, it runs off the main Task, and allows script processing to continue. If the script ends, the whole process and its spawned Tasks are stopped. This behavior is not good for a running web-service. To keep this from happening, two suggestions are:
Don't run the server off the main Task, by running synchronously. In code:
Genie.config.run_as_server = true
...
Genie.Server.up()
Make sure the main process does not end until the server Task ends. In code:
Base.JLOptions().isinteractive == 0 && wait()
The isinteractive condition, runs the wait() only when it is running as a script, as the usual desire when a REPL is present in interactive session, is to issue more commands, and the REPL keeps the server Task running in the background.

The HTTP request to the remote WebDriver server timed out after 60 seconds. Happens only when running through the task scheduler

I'm troubleshooting an Selenium script that runs through the Task Scheduler on a Windows Server. It's running in PowerShell using version 3.0.1 of the Selenium module (found here:https://www.powershellgallery.com/packages/Selenium/3.0.1) with the Edge browser (the one with Chromium).
The "The HTTP request to the remote WebDriver server for URL [localhost] timed out after 60 seconds." error has been quite persistent and only appears when run through the Task Scheduler. The script runs fine when running manually through ISE.
Also to note, there's another script that is more or less the same as the one having the issue, albeit using a slightly different url (same site). This second script runs without issue through the task scheduler. They're performing the same sequence of actions which is why I'm not entirely sure why it would fail for one script but not the other.
I haven't found a suitable solution while looking at other posters facing the same issue. Any help is much appreciated!
I had the same issue. I tried all kinds of code changes but the only step that worked for me was to change the Security Options in Task Scheduler.
Task (right-click) > Properties > General > Switch from Run whether user is logged on or not to Run only when the user is logged on.
I guess this would be a temporary solution. I'll keep looking and update this if I find a better solution.

How do Windows task scheduler recognise if the task fails

I have configured a application in Windows task scheduler to run for every 5 mints.
Expected true , but the application returns false and I expect the windows task scheduler to recognise it & restart. But it's not happening so far. Scheduler keeps running.
Note : I have enabled the option "to restart if the task fails for every" as well in scheduler.
Pls let me know where do I make mistake in understanding. Thanks.
After couple of hours on trial & error, found that system event would solve the above issue. scheduler doesn't track the error code of ongoing application, rather it will only the status whether its running or not.

Using Release Manager to kick off tests in MTM.

I am having an issue with kicking off test cases in Microsoft Test Manager from a script kicked off in Microsoft Release Manager. I can duplicate the issue when just running this command from powershell or command line. Here is the script:
C:\CODE\TCM\TCM.exe run /create /title:"Chads Example Test Case (Run from PowerShell)" /planid:31 /suiteid:2743 /configid:67 /settingsname:"DevWelisRemoteExecution" /testenvironment:"STAR_Regression" /collection:"http://tfssrv64:8080/tfs/DefaultCollection" /teamproject:QA /builddir:"\\tfssrv64\Builds" /include
Running this script returns a test run ID with no errors. I can immediately look in MTM and see the test run has started. It has a state of "pending". It eventually (some 20 minutes later) fails with the error "The test automation associated with the following test case could not be found: [48667]. Run the test case again using a build that contains the binary with the test automation.".
Facts: I can run the same test successfully, with a successful completion, from Microsoft Test Manager. (using the same settings specified in the script) Here are screen shots of the test runs from MTM.
Here is the MTM log of the successful test run.
The log of the successful test run.
Here is the same screen from the failed test run.
Here is the MTM log of the failed test run. Same test, ran from the above script.
The log of the failed test run.
Both test runs are using the same build number. Both test runs use the same test settings and configuration.
Any help would be greatly appreciated.....

Jenkins start JBOSS inside of a job and go on

I have a Jenkins job where I want to
- build my application
- start the jboss via batch
- sleep some time to wait for the jboss
- do some junit tests
- stop the jboss
The problem I have is that the job does not proceed after the jboss start. It shows the complete jboss log and just keeps refreshing this log.
So the sleep and junit tests are never executed.
batchcall im using:
cmd.exe /C F:\jboss-5.1.0.GA-jdk6\bin\run.bat -c Servername -Djboss.service.binding.set=ports-05 -Djboss.bind.address=0.0.0.0
I can't use the jenkins jboss management plugin because i have to set java_opts for this specific job.
Any idea how to start the Jboss without showing the log in the jenkins console?
EDIT :
Thanks for your answer, but call/start didn't work for me either.
My working solution:
(not nice but it works, just thought i should share it)
I created a 2nd Jenkins job which starts the JBoss with the batch call from above.
Then changed this job to be triggered remotely. "Trigger builds remotely"
Now i changed my 1st job to trigger the 2nd in a build step "Execute batch command"
wget --spider build_trigger_url
So my Job is doing this now:
build my application
trigger the jboss jenkins job via wget
this 2nd job is now also running on jenkins, until it is manually shut down
sleep some time, until the jboss is started
execute junit tests
stop the jboss
via jboss management plugin, this kills the 2nd job
You should change it to cmd.exe /C call F:\jboss-5.1.0.GA-jdk6\bin\run.bat <whatever params>
When you trigger a .bat it passes control to it and runs it until the .bat terminates. Instead, you need to spawn off another process to run the .bat. This is done with call command.