Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Process-Killer Script

DZone's Guide to

Process-Killer Script

DZone user Iffet Kurukose showcases a tool she developed with her team to kill automated test processes that run for too long.

· DevOps Zone
Free Resource

Download “The DevOps Journey - From Waterfall to Continuous Delivery” to learn learn about the importance of integrating automated testing into the DevOps workflow, brought to you in partnership with Sauce Labs.

This article focuses on a handy script for terminating stuck processes on Linux Systems. 

We are operating a big test automation system running mainly on Linux. From time to time, some Selenium processes get stuck and stop all test automation with absolutely no reason. Therefore, our Test Automation System becomes corrupted and does not run for a whole night.

To solve this problem, my team wrote a Linux Bash script; Process Killer. This script is scheduled and starts to search, find, and kill the processes running longer than expected. For example; it terminates a Selenium process which continues more than 30 minutes. 

The Process Killer script is designed to search any stuck process at defined time intervals with extensive logging capabilities. Search action is based on two defined variables:  PROCESS_TO_KILL  and KILLTIME. According to the defined values of these two variables, the script understands if the process time takes too long or not. For example; a defined process to kill is Selenium and the maximum duration is 30 minutes. If a Selenium process continues for longer than 30 minutes, the script terminates it. 

Process Killer Project can be downloaded from GitHub. Let me know what you think!

Discover how to optimize your DevOps workflows with our cloud-based automated testing infrastructure, brought to you in partnership with Sauce Labs

Topics:
linux ,os ,bash ,shell script ,test automation ,continuos integration

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}