[SERVER-28085] Fix "kill processes" function in evergreen.yml Created: 23/Feb/17  Updated: 06/Dec/17  Resolved: 28/Mar/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.2.12, 3.4.2, 3.5.3
Fix Version/s: 3.5.6

Type: Bug Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Jonathan Abrahams
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2, v3.0
Sprint: TIG 2017-04-17
Participants:
Linked BF Score: 0

 Description   

The "kill processes" function has a coding error:

pgrep_list_full=$(pgrep -f --list-full ".*" 2>&1 > /dev/null)
if [ -z "$pgrep_list_full" ]; then
...
fi

Since stdout & stderr are directed to /dev/null, this will always be true.

Similarly, this test is also flawed:

grep=grep
grep_extended=$(echo "a" | $grep -E "(a)" 2>&1 > /dev/null)
if [ ! -z "$grep_extended" ]; then
...
fi

The fix is to just direct stderr to /dev/null:

pgrep_list_full=$(pgrep -f --list-full ".*" 2> /dev/null)
if [ ! -z "$pgrep_list_full" ]; then
...
fi
...
grep_extended=$(echo "a" | $grep -E "(a)" 2> /dev/null)
...

An alternate fix would be to test for $?



 Comments   
Comment by Githook User [ 28/Mar/17 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-28085 Fix "kill processes" function in evergreen.yml
Branch: master
https://github.com/mongodb/mongo/commit/ea0e436f77b1a1e7977df55d6fd4d70c5aa7b9b8

Generated at Thu Feb 08 04:17:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.