Hi,

I use Jenkins test harness (jenkins-test-harness) v 1.551 to test my 
Jenkins plugin.
I'm wondering if there are any guidelines or "best practices" for writing 
the tests - I haven't found anything better than 
https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test.

My problem is that tests hang or get interrupted occasionally. Sometimes 
the tests pass (more often), sometimes they fail with thread interruption 
or they hang.

Few questions:
1) how does Jenkins JUnit rule organize tests if I run tests via Surefire 
Maven plugin without any custom settings (so it's 1 JVM and threads are 
reused)? 
2) is Jenkins instance shared by all the tests? I have a few tests that 
delete all the projects and then create the project with the same name - 
MY_PROJECT on set up (annotated by @Before). However, sometimes tests fail 
complaining that MY_PROJECT already exists - but quite rarely, probably 1 
in 10 times. It shouldn't have happened if tests would have different 
Jenkins instances. But if tests would share Jenkins, it would happen every 
time, not occasionally. I'm stunned.
2) how many threads are started by Jenkins rule? Probably only one; when I 
run the test, I am able to open the Jenkins instance in browser only if I 
put Thread.sleep() in test code. Is this correct?
3) how can I find out which test hangs and where?
4) why does Jenkins interrupt tests sometimes?
5) is jenkins-test-harness a good thing to use for integration tests, or 
there are better alternatives? Is 
https://github.com/jenkinsci/acceptance-test-harness a newer and better 
alternative?

I volunteer for documentation update if I understand how this thing works 
under the hood :)

Regards,
Kirill.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/c535026b-4e9d-408b-aac4-caea03562871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to