jest: Fresh jenkins installation crash when running jest.
Bug request
Bug
Current behavior
Using the official docker image of jenkins/ v2.46.2.
I have a webpack project that use jest-cli@19.0.2
that contain more than 500 hundreds of enzyme
test mainly.
Reproduction
-
Run jenkins (MUST have port
8080
free or change the host port)docker run -p 8080:8080 -v /var/jenkins_home jenkins
-
Print the secret key to be inserted on install
docker exec -i $(docker ps | grep jenkins | awk -F ' ' '{print $1}') cat /var/jenkins_home/secret.key
-
Past the key on
http://localhost:8080
and complete the jenkins installation -
Load from a CVS a project that use
jest-cli
19.0.2 and contains around 500 enzyme (mount/shallow) unit test. -
Configure a new project on Jenkins and import project from CVS
-
Create a build terminal step with
npm install
andnpm test
With a fresh installation and one project, jenkins crash during the build project.
This is my hardware configuration, I don’t think it is the issue here
CPU
Intel(R) Xeon(R) CPU D-1540 @ 2.00GHz
Cores : 16
Cache : 12288KB
RAM
2x 16384MB
Disks
2 x 2000 GB
Motherboard
X10SDV-TLN4F
Kernel version
3.14.32-xxxx-grs-ipv6-64
node version 7.9.0
Expected behavior
jenkins should perform the jest command to the end.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (3 by maintainers)
Are you running the tests with the Jest --runInBand cli option? Else can try that.
I apologize for the tutorial, and would like to thanks in advance the person who will achieve it.
I am not confident that test will crash in your environment if you are not running your container on mesos/marathon.
In case you just wan’t to see the crash , I have recorded it with my smartphone, it’s not a professional footage but you can see it :
https://drive.google.com/file/d/0B6drRJ3_BeQSMVh2RWE4cnc2NUU/view
Prerequesite
In order to be exactly with the same configuration, you will need Host 32H offer at OVH.
During my test, I use the following configuration with Debian Jessie 8.0:
Jenkins installation
Download and run jenkins official image. From a separate bash: (you must have port 8080 available)
You will see in your terminal password. Copy it.
Or this will print the content of
/var/jenkins_home/secrets/initialAdminPassword
:http://localhost:8080/
and past the codeValidate the change
https://github.com/kopax/jest-crashing-jenkins
htop
to view your memory usage (sudo apt-get update && sudo apt-get install htop -y
)Also you should note the
CONTAINER_ID
so you will see when it crashI wasn’t able to reproduce the crash it except in my production environment.
This is how my test fail in production :
Notice the Jobs id 48, because when Jenkins will come back, it will miss that ID and jenkins will do like nothing happened before.
Tips 1: If you wish to have a more verbose log level when doing logs of your container you can do the following withing the containers, I have already checked and there is nothing interesting into:
And then restart your container with :
Tips 2: If you want to upgrade jenkins to the latest version (see the warning), you can activate a hidden button “Upgrade jenkins automatically button”. For that, you need to give the good permissions to
/usr/share/jenkins
within the container, this will make the button appear in the “Jenkins Configuration” page and you will then be able to upgrade JenkinsNote that I am running my Jenkins container on Mesos/Marathon and I only have the issue here. As attachement this is the marathon deployement json I use for deploying my jenkins container:
It’s only in mesos where the container get killed with an exit code 137 :