JUnit timeout after running for 60 mins - junit

I have a test project for my actual code that resides in another project.
for example, if there is FunctionalModule that has all the code concerning the functionality, I have a test project FunctionalModuleTest.
My ant runs the tests from FuntionalModuleTest and code in the FuntionalModule project is tested.
There are many test cases and after 60 mins, the run halts with an error message -
"The following TestProjects were killed for running past the timeout (60mins).
Where is this configured? My ant and emma does not have the timeout configured. It is not in project properties. I want a way to override this config and keep the timeout unbounded.
Adding more information : Nov 22 2011
I am using ANT 1.7.0, Unbreakable linux [Linux ME 2.6.18-164.0.0.0.1.el5 #1 SMP Thu Sep 3 00:21:28 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux], Java with OracleDB

What is causing your tests to take so long? You may want to break up your test suite into unit test (should be fast) and integration/system tests (can be slow). I would look at speeding up your tests before expanding the timeout.
This Nabble Thread seems to indicate it's your TestRunner, not Junit. If you want to set a global max for all tests, you can look at The Timeout class in JUnit or The elements for the Test Annotation

Well, the default 60 min timeout is set by ANT.
And to alter that, or to override that property, a command line property:
Dtest.lrg.timeout=240
(4 hrs) has to be added.

Related

Disable a sequence container in SSIS using SQL query?

Suppose I have a SSIS package which is having almost 20 sequence containers and while running the job, a few sequence container got completed successfully but a few fail. So, here I want an automated SQL query to disable the completed sequence container and enable the failed sequence container so that if I run the package again, then it will run only failed sequence container.
Is there any chance to disable the completed sequence container and run the failed one?
Personally, I detest checkpoints. They don't work within the context of a loop and maybe it's just my bad luck, but I have far too often experienced a corruption of the checkpoint file
I always advise clients to design their ETL solutions with restartability in mind. At some point, the process will fail and you know it's going to be in the middle of something crucial so remove the "thinking" aspect of getting it restarted. Don't make it depend on someone running a script to clean up half committed loads, etc. But that's a different question...
Every object in your control flow will support a property called Disable. When you run a package, you can deactivate tasks via the /SET command. Given the following example, each sequence container has a Script Task that does nothing but fires an information event
When I run that from the command line,
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash>dtexec /file SO_61477591.dtsx /rep i
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3238.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 10:45:43 AM
Info: 2020-04-28 10:45:43.71
Code: 0x00000000
Source: SCR0 SCR Echo Back
Description: System::ParentContainerGUID : {3910E325-F3D0-4EC6-96FD-5E125FEC0ED2}
End Info
Info: 2020-04-28 10:45:43.74
Code: 0x00000000
Source: SCR1 SCR Echo Back
Description: System::ParentContainerGUID : {08bf88d5-71c3-4105-824e-bb8b1e942b24}
End Info
Info: 2020-04-28 10:45:43.77
Code: 0x00000000
Source: SCR2 SCR Echo Back
Description: System::ParentContainerGUID : {59823604-1caf-4a90-9303-45d55126d8b3}
End Info
Info: 2020-04-28 10:45:43.80
Code: 0x00000000
Source: SCR3 SCR Echo Back
Description: System::ParentContainerGUID : {977567f1-6bcf-4c84-909e-eb18ba17165d}
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 10:45:43 AM
Finished: 10:45:43 AM
Elapsed: 0.609 seconds
By specifying the path to the executable, I can set the property disable property like /set \Package\SEQC1.Properties[Disable];"True" where SEQC1 is the case sensitive name of the object I want to disable
C:\Users\bfellows\source\repos\SO_Trash\SO_Trash>dtexec /file .\SO_61477591.dtsx /rep i /set \Package\SEQC1.Properties[Disable];"True"
Microsoft (R) SQL Server Execute Package Utility
Version 14.0.3238.1 for 32-bit
Copyright (C) 2017 Microsoft. All rights reserved.
Started: 10:45:50 AM
Info: 2020-04-28 10:45:50.62
Code: 0x00000000
Source: SCR0 SCR Echo Back
Description: System::ParentContainerGUID : {3910E325-F3D0-4EC6-96FD-5E125FEC0ED2}
End Info
Info: 2020-04-28 10:45:50.66
Code: 0x00000000
Source: SCR2 SCR Echo Back
Description: System::ParentContainerGUID : {59823604-1caf-4a90-9303-45d55126d8b3}
End Info
Info: 2020-04-28 10:45:50.69
Code: 0x00000000
Source: SCR3 SCR Echo Back
Description: System::ParentContainerGUID : {977567f1-6bcf-4c84-909e-eb18ba17165d}
End Info
DTExec: The package execution returned DTSER_SUCCESS (0).
Started: 10:45:50 AM
Finished: 10:45:50 AM
Elapsed: 0.609 seconds
Notice that SCR1 is no longer in the output due to the SET command disabling it.
Knowing how to disable tasks, you could leave the package as-is and modify your start to be text generated from SQL Queries (give me all the tasks that have completed and build the correct /SET statements)
A better approach that would require modification to the existing package would be have an Execute SQL Task(s) that runs at the start of the package and it sets Boolean SSIS variables with an indicator of whether the Task should be disabled. And then modify each object to have an expression on the Disable property that is the new SSIS variable.
Personally, my approach is to make many SSIS packages. Each package is a unit of work (load sales table). When a package fires, it records that execution has begun. When it completes successfully, it records that it has completed (as well has how many rows inserted/updated/deleted)
I then have a orchestrator package that queries the list of known packages and identifies any package that has not run successfully. It then uses a foreach loop with an Execute package task to then start running the child processes.
An advantage to my approach is that, assuming no dependencies between task 1 and 3, I could have two copies of this running - one "stack" handles the package 0 and 2, while a different stack handles 1 and 3. One of the advantages of SSIS is that it makes it trivial to parallelize your workload.
You can use CHECKPOINT file feature in SSIS to automatically run only the failed containers in the control flow task. It is available out of the box in SSIS. You can configure it in the package.
Read more on Checkpoint usage & Restart packages using checkpoint on MSDN

Selenium Timedout Exception while running test cases from Jenkins

Am running a set of test cases from Jenkins. All the test cases are failing with org.openqa.selenium.TimedoutException on all the functions. I have tested the same code using eclipse in local and its executing fine. Please check on the below error and help on resolving this issue
Configurations:
Selenium- standalone - jar - 2.53
Chromedriver - 2.36
Chrome Browser - 65
testng jar = 6.8
Code Sample:
WebDriverWait wait = new WebDriverWait(driver, 1000);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString())));
WebElement el = driver.findElement(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString()));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", el);
WebElementClick(" ",ORCollection.get("BtnMDUEligibilityClick").toString());
Thread.sleep(10000);
Logs:
org.openqa.selenium.TimeoutException: Timed out after 40 seconds waiting for visibility of element located by By.xpath: //button[contains(#class,'js-submit')]
I have increased webdriver.wait value in code from 40 seconds to 1000 but still we are getting the same error as Timedout.
I assume that your XPath expressions are correct and you can manually open the browser on the Jenkins slave machine.
The issue could be connected with the lack of interactive desktop. This could happen if you have installed Jenkins on the slave machine as windows service. The recommended for Windows way to control a Windows slave is by using Launch slave agents via Java Web Start. More info here and here.

karma-detect-browsers cannot detect launchers for any browsers anymore

Last week, without any changing of our configurations or dependencies, our builds started failing.
The errors we are getting during any run of any karma tests are along the lines of:
26 03 2018 10:25:34.870:INFO [framework.detect-browsers]: The following browsers were detected on your system: [ 'Chrome', 'Chromium' ]
26 03 2018 10:25:34.874:WARN [framework.detect-browsers]: No launcher found for browser Chrome, it will not be used.
26 03 2018 10:25:34.874:WARN [framework.detect-browsers]: No launcher found for browser Chromium, it will not be used.
26 03 2018 10:25:34.874:INFO [framework.detect-browsers]: The following browsers will be used: []
We can replicate this on all machines across versions 1 of karma-detect-browsers, all the way up to the latest 2.3.1.
All the machines may use potentially slightly different versions of node and npm, but our CI server where this was first detected uses node version 8.4.0 and npm version 5.3.0.
Not sure if anyone else has had this problem or can offer some advice?
We have had the same issue today. The issue is with a minor version of karma-detect-browsers. Try locking the version to 2.2.6 and reinstall, then test again.
This fixed the problem for us. We'll report it back to the package maintainer.

Why won't DraftSight run on Fedora 26 with Intel graphics?

DraftSight 2017SP1 Linux (beta) worked on Fedora 24. It fails after upgrading to Fedora 26. Running it from the command line so you can see the low-level errors,
/opt/dassault-systemes/DraftSight/Linux/DraftSight
Qt: Session management error: None of the authentication protocols specified are supported
Could not parse stylesheet of object 0x238a050
Could not parse stylesheet of object 0x238a050
In the graphics environment you see the usual start screens, then error pop-ups which offer to report the error and then close the application when clicked. One says that error-reporting is not available.
Similarly with 2017SP3 and 2018SP0. Fedora updates are current as of today.
This system is an Intel core i3. lspci reports "Intel Corp Xeon E3-1200 v3/4th Gen core processor Integrated Graphics Controller (rev 06)"
2018SP0 does work once an Nvidia GT710 card and the nvidia driver module are installed. It does not work with the nouveau driver module and the same card.
Does anybody have any insight as to the cause? A regression in Fedora, or a latent bug in DraftSight, or anything else?
Knowing whether it works with Fedora 26 and AMD graphics might be very helpful.
Edit March 2018
Doesn't work but differently on a system with AMD R5 230. No "Could not parse" errors, not anything else on the terminal window, but Draftsight starts up with the display all wrong and then locks up. Clicking the "X" gets to "the program is not responding".
Also worth noting that this isn't a Wayland issue. Systems are running Cinnamon and lightdm, so it's good old X.
Also a work-around, if performance is unimportant. (And it probably isn't, with Gen 4 Intel Graphics). Run it as a "remote" application on localhost, on a system with Intel graphics.
$ ssh -X 127.0.0.1
password:
Last login: Wed Mar ...
-bash-4.4$ /opt/dassault-systemes/DraftSight/Linux/DraftSight
(success)
Further update Fedora 29, DraftSight 2018SP3
New wrinkles for Nvidia, Cinnamon as above
Needs invocation
LD_PRELOAD=/usr/lib64/libfreetype.so.6 /opt/dassault-systemes/DraftSight/Linux/DraftSight
otherwise fails with /lib64/libfontconfig.so.1 lookup error FT_DOne_MM_Var
Also kernel 4.20 plus NVidia 390.87 fails to build. There's a patched NVidia installer that does work at if_not_false_then_true site.
Also does not install a .desktop file into /usr/share/applications
I had similar problems when I updated Fedora 24 to 25. The parse stylesheet messages still show up but I can run draftsight from an Xorg session, (not Wayland), using the nouveau drivers but only under root privileges using sudo .
You might try the following script:
sudo DISPLAY=$DISPLAY vblank_mode=1 /opt/dassault-systemes/DraftSight/Linux/DraftSight
I can only get DraftSight to run as root under Fedora 27, 4.18.16-100.fc27.x86_64. I have installed a VM with Ubuntu, and it runs fine, without elevated privileges.

Django + OS X + MySQL + first session variable retrieval = crash

Am experienced with Django, Apache, WSGI, MySql, etc. and have this environment setup and working fine on another OS X computer running Lion. Django session backend is db, session middleware and app are both enabled properly in settings. During first request of site view, we set a request.session key/value, which this first time thru works fine. On subsequent view though when we check if the key/value exists, we get a server-level 500 error that even with Debug mode on doesn't make it to the python interpreter to generate a full stack trace exception. The apache log generates the following messages...
[Mon Apr 16 14:26:22 2012] [notice] Apache/2.2.21 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7.1 mod_ssl/2.2.21 OpenSSL/0.9.8r configured -- resuming normal operations
[Mon Apr 16 14:26:27 2012] [info] mod_wsgi (pid=2362): Create interpreter 'snap.joe|'.
[Mon Apr 16 14:26:27 2012] [info] [client 127.0.0.1] mod_wsgi (pid=2362, process='snap', application='snap.joe|'): Loading WSGI script '/var/www/venvs/snap_env/snap/wsgi/wsgi.py'.
[Mon Apr 16 14:26:32 2012] [error] [client 127.0.0.1] Premature end of script headers: wsgi.py
[Mon Apr 16 14:26:33 2012] [notice] child pid 2362 exit signal Bus error (10)
Have checked that a MySQL db table django_session row is added properly with session_data and also the cookie set in the browser after the first request contains the proper/matching session_id. If I add a simple request.session.flush() just before the existing session code, we can bypass the error obviously because there is never anything in the session. One more thing, the value we are adding to the session key/value store is a Django QuerySet object. Again, this is working on a live CentOS server, and also another Mac OS X Lion machine (albeit running Python 2.6 instead of 2.7).
Any ideas folks? Many thanks!
See documented reasons at:
http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions#Apache_Process_Crashes
and follow further links for possible workarounds.
In short, can be shared library version conflict, using mod_python at same time, or extension module for Python that doesn't work with sub interpreter.
If this is only Python site on that Apache, set:
WSGIApplicationGroup %{GLOBAL}
for one potential quick solution.
A few thoughts:
1) are you running the same versions of modules? Django just recently updated (1.4), so if you did a pip install and didn't specify a version your production might have an older version while your development has the newer one.
2) Can you test this using just the manage.py runserver? My suspicions are that it's something to do with the apache config (so if it works fine in runserver, that means the issue is with apache).