[SPARK-5161] [HOTFIX] Fix bug in Python test failure reporting
[SPARK-5161] [HOTFIX] Fix bug in Python test failure reporting

This patch fixes a bug introduced in #7031 which can cause Jenkins to incorrectly report a build with failed Python tests as passing if an error occurred while printing the test failure message.

Author: Josh Rosen <joshrosen@databricks.com>

Closes #7112 from JoshRosen/python-tests-hotfix and squashes the following commits:

c3f2961 [Josh Rosen] Hotfix for bug in Python test failure reporting

dbtsai/spark,adrian-ionescu/apache-spark,facaiy/spark,alunarbeach/spark,aosagie/spark,hvanhovell/spark,liyichao/spark,kimoonkim/spark,ioana-delaney/spark,guoxiaolongzte/spark,bravo-zhang/spark,alunarbeach/spark,highfei2011/spark,LantaoJin/spark,rekhajoshm/spark,panfengfeng/spark,haowu80s/spark,highfei2011/spark,huang1900/spark,setjet/spark,liutang123/spark,brad-kaiser/spark,SHASHANKB/spark,LantaoJin/spark,hhbyyh/spark,ConeyLiu/spark,kissmetrics/spark,andrewor14/spark,szhem/spark,metamx/spark,cin/spark,maropu/spark,bravo-zhang/spark,michalsenkyr/spark,shaneknapp/spark,joseph-torres/spark,metamx/spark,publicRoman/spark,cloud-fan/spark,vinodkc/spark,ajaysaini725/spark,pgandhi999/spark,saltstar/spark,xuanyuanking/spark,xuanyuanking/spark,ron8hu/spark,nlalevee/spark,saltstar/spark,WindCanDie/spark,liutang123/spark,icexelloss/spark,mdespriee/spark,mdespriee/spark,cin/spark,darionyaphet/spark,mahak/spark,setjet/spark,haowu80s/spark,taroplus/spark,debugger87/spark,techaddict/spark,shaneknapp/spark,UndeadBaneGitHub/spark,tejasapatil/spark,1haodian/spark,xflin/spark,Aegeaner/spark,andrewor14/spark,gengliangwang/spark,markhamstra/spark,ptkool/spark,apache-spark-on-k8s/spark,kimoonkim/spark,milliman/spark,ioana-delaney/spark,skonto/spark,liutang123/spark,holdenk/spark,eyalfa/spark,wangmiao1981/spark,icexelloss/spark,ddna1021/spark,janewangfb/spark,sachintyagi22/spark,shubhamchopra/spark,andrewor14/spark,gengliangwang/spark,akopich/spark,joseph-torres/spark,nlalevee/spark,shuangshuangwang/spark,map222/spark,cin/spark,JoshRosen/spark,patrick-nicholson/spark,taroplus/spark,byakuinss/spark,UndeadBaneGitHub/spark,ConeyLiu/spark,zero323/spark,ueshin/apache-spark,debugger87/spark,mdespriee/spark,poffuomo/spark,markhamstra/spark,apache-spark-on-k8s/spark,ddna1021/spark,jlopezmalla/spark,highfei2011/spark,mike0sv/spark,eyalfa/spark,highfei2011/spark,JerryLead/spark,facaiy/spark,narahari92/spark,rezasafi/spark,xflin/spark,jkbradley/spark,yanboliang/spark,gengliangwang/spark,gioenn/xSpark,darionyaphet/spark,1haodian/spark,andrewor14/spark,chuckchen/spark,sureshthalamati/spark,skonto/spark,ueshin/apache-spark,liutang123/spark,ron8hu/spark,hhbyyh/spark,jianran/spark,HyukjinKwon/spark,kimoonkim/spark,panfengfeng/spark,bdrillard/spark,saturday-shi/spark,jkbradley/spark,setjet/spark,witgo/spark,mzl9039/spark,jlopezmalla/spark,szhem/spark,HyukjinKwon/spark,dhruve/spark,taroplus/spark,holdenk/spark,caneGuy/spark,tejasapatil/spark,debugger87/spark,jiangxb1987/spark,BryanCutler/spark,SHASHANKB/spark,srowen/spark,vinodkc/spark,brad-kaiser/spark,kissmetrics/spark,bdrillard/spark,gioenn/xSpark,minixalpha/spark,icexelloss/spark,ConeyLiu/spark,kissmetrics/spark,ioana-delaney/spark,michalsenkyr/spark,kiszk/spark,zzcclp/spark,SHASHANKB/spark,ron8hu/spark,janewangfb/spark,actuaryzhang/spark,kevinyu98/spark,liyichao/spark,apache/spark,ajaysaini725/spark,dbtsai/spark,saturday-shi/spark,xflin/spark,pgandhi999/spark,holdenk/spark,nilsgrabbert/spark,SHASHANKB/spark,pgandhi999/spark,bOOm-X/spark,shubhamchopra/spark,sachintyagi22/spark,pronix/spark,kiszk/spark,chuckchen/spark,MLnick/spark,alunarbeach/spark,HyukjinKwon/spark,saturday-shi/spark,nchammas/spark,jiangxb1987/spark,HyukjinKwon/spark,xflin/spark,Panos-Bletsos/spark-cost-model-optimizer,kiszk/spark,srowen/spark,aokolnychyi/spark,1haodian/spark,holdenk/spark,bOOm-X/spark,sachintyagi22/spark,eyalfa/spark,bdrillard/spark,gioenn/xSpark,milliman/spark,jiangxb1987/spark,ddna1021/spark,skonto/spark,xuanyuanking/spark,rezasafi/spark,taroplus/spark,wangyum/spark,jianran/spark,loneknightpy/spark,zhouyejoe/spark,setjet/spark,wangyum/spark,rednaxelafx/apache-spark,JoshRosen/spark,nilsgrabbert/spark,mike0sv/spark,sureshthalamati/spark,jkbradley/spark,jlopezmalla/spark,highfei2011/spark,publicRoman/spark,wangmiao1981/spark,aray/spark,taroplus/spark,sureshthalamati/spark,loneknightpy/spark,someorz/spark,SnappyDataInc/spark,kissmetrics/spark,ibm-research-ireland/sparkoscope,akopich/spark,aosagie/spark,zzcclp/spark,witgo/spark,apache-spark-on-k8s/spark,xflin/spark,minixalpha/spark,jiangxb1987/spark,gengliangwang/spark,andrewor14/spark,brad-kaiser/spark,janewangfb/spark,michalsenkyr/spark,wangmiao1981/spark,xuanyuanking/spark,shubhamchopra/spark,tengpeng/spark,milliman/spark,techaddict/spark,setjet/spark,gioenn/xSpark,lvdongr/spark,shaneknapp/spark,apache/spark,xflin/spark,minixalpha/spark,yanboliang/spark,ibm-research-ireland/sparkoscope,chuckchen/spark,dhruve/spark,milliman/spark,loneknightpy/spark,map222/spark,JoshRosen/spark,lvdongr/spark,kimoonkim/spark,minixalpha/spark,liyichao/spark,minixalpha/spark,alunarbeach/spark,UndeadBaneGitHub/spark,gioenn/xSpark,maropu/spark,1haodian/spark,milliman/spark,rednaxelafx/apache-spark,janewangfb/spark,poffuomo/spark,Panos-Bletsos/spark-cost-model-optimizer,sahilTakiar/spark,spark-test/spark,markhamstra/spark,andrewor14/spark,witgo/spark,wzhfy/spark,guoxiaolongzte/spark,spark-test/spark,jkbradley/spark,spark-test/spark,big-pegasus/spark,apache-spark-on-k8s/spark,WeichenXu123/spark,michalsenkyr/spark,LantaoJin/spark,dbtsai/spark,spark-test/spark,rekhajoshm/spark,actuaryzhang/spark,rezasafi/spark,someorz/spark,esi-mineset/spark,LantaoJin/spark,shubhamchopra/spark,techaddict/spark,loneknightpy/spark,BryanCutler/spark,joseph-torres/spark,hhbyyh/spark,map222/spark,alunarbeach/spark,dongjoon-hyun/spark,yanboliang/spark,jianran/spark,jlopezmalla/spark,saturday-shi/spark,big-pegasus/spark,goldmedal/spark,wzhfy/spark,eyalfa/spark,rikima/spark,ericvandenbergfb/spark,hhbyyh/spark,caneGuy/spark,huang1900/spark,sachintyagi22/spark,aray/spark,nlalevee/spark,darionyaphet/spark,mzl9039/spark,someorz/spark,aosagie/spark,kevinyu98/spark,wangyum/spark,witgo/spark,ibm-research-ireland/sparkoscope,someorz/spark,markhamstra/spark,WeichenXu123/spark,WindCanDie/spark,SHASHANKB/spark,narahari92/spark,kimoonkim/spark,nchammas/spark,tejasapatil/spark,esi-mineset/spark,liutang123/spark,WeichenXu123/spark,facaiy/spark,ioana-delaney/spark,aosagie/spark,techaddict/spark,esi-mineset/spark,witgo/spark,huang1900/spark,big-pegasus/spark,LantaoJin/spark,dbtsai/spark,pronix/spark,joseph-torres/spark,facaiy/spark,cloud-fan/spark,mdespriee/spark,someorz/spark,goldmedal/spark,sahilTakiar/spark,wzhfy/spark,WindCanDie/spark,mahak/spark,apache/spark,matthewfranglen/spark,haowu80s/spark,hvanhovell/spark,bravo-zhang/spark,setjet/spark,brad-kaiser/spark,liyichao/spark,darionyaphet/spark,hhbyyh/spark,icexelloss/spark,jianran/spark,ron8hu/spark,lxsmnv/spark,Panos-Bletsos/spark-cost-model-optimizer,jlopezmalla/spark,maropu/spark,spark-test/spark,poffuomo/spark,shuangshuangwang/spark,sachintyagi22/spark,ron8hu/spark,facaiy/spark,shuangshuangwang/spark,poffuomo/spark,WeichenXu123/spark,rekhajoshm/spark,andrewor14/spark,metamx/spark,SnappyDataInc/spark,minixalpha/spark,JoshRosen/spark,dongjoon-hyun/spark,aosagie/spark,wzhfy/spark,caneGuy/spark,brad-kaiser/spark,bravo-zhang/spark,jrshust/spark,gengliangwang/spark,zero323/spark,ericvandenbergfb/spark,nilsgrabbert/spark,stanzhai/spark,kiszk/spark,kiszk/spark,bravo-zhang/spark,Aegeaner/spark,kiszk/spark,stanzhai/spark,xflin/spark,apache-spark-on-k8s/spark,cloud-fan/spark,wangmiao1981/spark,holdenk/spark,apache-spark-on-k8s/spark,debugger87/spark,rednaxelafx/apache-spark,mdespriee/spark,stanzhai/spark,holdenk/spark,cin/spark,haowu80s/spark,goldmedal/spark,spark-test/spark,rednaxelafx/apache-spark,highfei2011/spark,rikima/spark,techaddict/spark,sureshthalamati/spark,cloud-fan/spark,chuckchen/spark,dhruve/spark,esi-mineset/spark,metamx/spark,bdrillard/spark,aokolnychyi/spark,vinodkc/spark,gioenn/xSpark,wangyum/spark,MLnick/spark,nlalevee/spark,bravo-zhang/spark,bdrillard/spark,map222/spark,ahnqirage/spark,map222/spark,joseph-torres/spark,saturday-shi/spark,BryanCutler/spark,zhouyejoe/spark,eyalfa/spark,big-pegasus/spark,pronix/spark,someorz/spark,saltstar/spark,JerryLead/spark,mdespriee/spark,rezasafi/spark,kevinyu98/spark,LantaoJin/spark,nlalevee/spark,JoshRosen/spark,rezasafi/spark,lvdongr/spark,wzhfy/spark,MLnick/spark,xuanyuanking/spark,WeichenXu123/spark,srowen/spark,aray/spark,esi-mineset/spark,akopich/spark,nilsgrabbert/spark,zero323/spark,dongjoon-hyun/spark,ddna1021/spark,adrian-ionescu/apache-spark,facaiy/spark,wangmiao1981/spark,rekhajoshm/spark,aosagie/spark,ibm-research-ireland/sparkoscope,BryanCutler/spark,janewangfb/spark,jrshust/spark,akopich/spark,dhruve/spark,patrick-nicholson/spark,sachintyagi22/spark,guoxiaolongzte/spark,narahari92/spark,icexelloss/spark,maropu/spark,zuotingbing/spark,mahak/spark,BryanCutler/spark,kevinyu98/spark,zhouyejoe/spark,rednaxelafx/apache-spark,jkbradley/spark,markhamstra/spark,narahari92/spark,wzhfy/spark,zero323/spark,ahnqirage/spark,saturday-shi/spark,tengpeng/spark,spark-test/spark,tengpeng/spark,xuanyuanking/spark,alunarbeach/spark,apache-spark-on-k8s/spark,actuaryzhang/spark,pronix/spark,zuotingbing/spark,brad-kaiser/spark,actuaryzhang/spark,patrick-nicholson/spark,rezasafi/spark,shaneknapp/spark,Aegeaner/spark,patrick-nicholson/spark,szhem/spark,apache/spark,rekhajoshm/spark,loneknightpy/spark,WeichenXu123/spark,mike0sv/spark,aokolnychyi/spark,byakuinss/spark,stanzhai/spark,narahari92/spark,tejasapatil/spark,big-pegasus/spark,MLnick/spark,lxsmnv/spark,zzcclp/spark,mzl9039/spark,tejasapatil/spark,byakuinss/spark,zzcclp/spark,dbtsai/spark,stanzhai/spark,JoshRosen/spark,huang1900/spark,hvanhovell/spark,ddna1021/spark,rekhajoshm/spark,pgandhi999/spark,kevinyu98/spark,aray/spark,adrian-ionescu/apache-spark,goldmedal/spark,zhouyejoe/spark,UndeadBaneGitHub/spark,nlalevee/spark,lxsmnv/spark,lxsmnv/spark,Panos-Bletsos/spark-cost-model-optimizer,yanboliang/spark,bOOm-X/spark,brad-kaiser/spark,yanboliang/spark,Aegeaner/spark,kissmetrics/spark,MLnick/spark,kissmetrics/spark,MLnick/spark,vinodkc/spark,highfei2011/spark,saltstar/spark,caneGuy/spark,metamx/spark,maropu/spark,ajaysaini725/spark,michalsenkyr/spark,ioana-delaney/spark,actuaryzhang/spark,sahilTakiar/spark,tejasapatil/spark,1haodian/spark,taroplus/spark,panfengfeng/spark,dbtsai/spark,panfengfeng/spark,kevinyu98/spark,rikima/spark,metamx/spark,srowen/spark,ConeyLiu/spark,jrshust/spark,ptkool/spark,skonto/spark,goldmedal/spark,akopich/spark,lxsmnv/spark,wangmiao1981/spark,srowen/spark,huang1900/spark,ron8hu/spark,jianran/spark,szhem/spark,zero323/spark,saltstar/spark,rikima/spark,cin/spark,panfengfeng/spark,cloud-fan/spark,1haodian/spark,jianran/spark,ahnqirage/spark,rednaxelafx/apache-spark,ptkool/spark,mzl9039/spark,rikima/spark,dbtsai/spark,byakuinss/spark,sureshthalamati/spark,lvdongr/spark,ajaysaini725/spark,akopich/spark,tengpeng/spark,minixalpha/spark,nchammas/spark,gioenn/xSpark,ueshin/apache-spark,hvanhovell/spark,akopich/spark,debugger87/spark,mike0sv/spark,dhruve/spark,bravo-zhang/spark,mzl9039/spark,jiangxb1987/spark,Aegeaner/spark,shuangshuangwang/spark,jrshust/spark,shuangshuangwang/spark,ron8hu/spark,sureshthalamati/spark,stanzhai/spark,cin/spark,loneknightpy/spark,big-pegasus/spark,ddna1021/spark,zzcclp/spark,milliman/spark,zhouyejoe/spark,setjet/spark,LantaoJin/spark,zero323/spark,map222/spark,nchammas/spark,lvdongr/spark,ueshin/apache-spark,ioana-delaney/spark,WeichenXu123/spark,WindCanDie/spark,ajaysaini725/spark,Aegeaner/spark,pgandhi999/spark,tengpeng/spark,JoshRosen/spark,ptkool/spark,HyukjinKwon/spark,saltstar/spark,sahilTakiar/spark,pronix/spark,darionyaphet/spark,WindCanDie/spark,zzcclp/spark,kissmetrics/spark,sahilTakiar/spark,JerryLead/spark,apache/spark,michalsenkyr/spark,dongjoon-hyun/spark,publicRoman/spark,ConeyLiu/spark,loneknightpy/spark,sahilTakiar/spark,jkbradley/spark,caneGuy/spark,saturday-shi/spark,Panos-Bletsos/spark-cost-model-optimizer,jrshust/spark,aray/spark,aokolnychyi/spark,gengliangwang/spark,MLnick/spark,debugger87/spark,nilsgrabbert/spark,szhem/spark,UndeadBaneGitHub/spark,dhruve/spark,zuotingbing/spark,yanboliang/spark,jrshust/spark,nchammas/spark,yanboliang/spark,wzhfy/spark,lxsmnv/spark,Panos-Bletsos/spark-cost-model-optimizer,liyichao/spark,actuaryzhang/spark,joseph-torres/spark,kevinyu98/spark,jlopezmalla/spark,mike0sv/spark,nilsgrabbert/spark,pgandhi999/spark,rednaxelafx/apache-spark,rikima/spark,stanzhai/spark,eyalfa/spark,maropu/spark,ahnqirage/spark,szhem/spark,liyichao/spark,icexelloss/spark,UndeadBaneGitHub/spark,esi-mineset/spark,nilsgrabbert/spark,ericvandenbergfb/spark,patrick-nicholson/spark,ptkool/spark,adrian-ionescu/apache-spark,shaneknapp/spark,wangyum/spark,bOOm-X/spark,bdrillard/spark,janewangfb/spark,JerryLead/spark,lvdongr/spark,michalsenkyr/spark,bOOm-X/spark,dongjoon-hyun/spark,mahak/spark,witgo/spark,shaneknapp/spark,witgo/spark,big-pegasus/spark,dongjoon-hyun/spark,aray/spark,zhouyejoe/spark,ptkool/spark,chuckchen/spark,actuaryzhang/spark,jianran/spark,holdenk/spark,ueshin/apache-spark,wangmiao1981/spark,markhamstra/spark,hhbyyh/spark,apache/spark,dongjoon-hyun/spark,zero323/spark,ahnqirage/spark,guoxiaolongzte/spark,hvanhovell/spark,1haodian/spark,saltstar/spark,SnappyDataInc/spark,SHASHANKB/spark,darionyaphet/spark,mzl9039/spark,cloud-fan/spark,mahak/spark,markhamstra/spark,caneGuy/spark,ioana-delaney/spark,ahnqirage/spark,aokolnychyi/spark,skonto/spark,ajaysaini725/spark,zzcclp/spark,haowu80s/spark,ueshin/apache-spark,aray/spark,haowu80s/spark,hhbyyh/spark,aosagie/spark,someorz/spark,zuotingbing/spark,bOOm-X/spark,gengliangwang/spark,jkbradley/spark,janewangfb/spark,nlalevee/spark,rikima/spark,kiszk/spark,patrick-nicholson/spark,bdrillard/spark,ericvandenbergfb/spark,taroplus/spark,caneGuy/spark,maropu/spark,rekhajoshm/spark,ibm-research-ireland/sparkoscope,dhruve/spark,techaddict/spark,SnappyDataInc/spark,jiangxb1987/spark,guoxiaolongzte/spark,goldmedal/spark,SnappyDataInc/spark,narahari92/spark,guoxiaolongzte/spark,ericvandenbergfb/spark,ajaysaini725/spark,kimoonkim/spark,liutang123/spark,eyalfa/spark,sachintyagi22/spark,panfengfeng/spark,nchammas/spark,publicRoman/spark,UndeadBaneGitHub/spark,aokolnychyi/spark,guoxiaolongzte/spark,pgandhi999/spark,huang1900/spark,shubhamchopra/spark,debugger87/spark,zuotingbing/spark,darionyaphet/spark,shuangshuangwang/spark,ddna1021/spark,vinodkc/spark,patrick-nicholson/spark,SHASHANKB/spark,kimoonkim/spark,ConeyLiu/spark,jiangxb1987/spark,ptkool/spark,byakuinss/spark,chuckchen/spark,alunarbeach/spark,JerryLead/spark,wangyum/spark,shaneknapp/spark,skonto/spark,adrian-ionescu/apache-spark,adrian-ionescu/apache-spark,shuangshuangwang/spark,xuanyuanking/spark,sureshthalamati/spark,skonto/spark,techaddict/spark,sahilTakiar/spark,panfengfeng/spark,srowen/spark,esi-mineset/spark,ueshin/apache-spark,map222/spark,bOOm-X/spark,pronix/spark,ibm-research-ireland/sparkoscope,aokolnychyi/spark,nchammas/spark,ahnqirage/spark,liyichao/spark,rezasafi/spark,cin/spark,icexelloss/spark,szhem/spark,tengpeng/spark,huang1900/spark,ConeyLiu/spark,srowen/spark,adrian-ionescu/apache-spark,BryanCutler/spark,SnappyDataInc/spark,publicRoman/spark,hvanhovell/spark,hvanhovell/spark,poffuomo/spark,metamx/spark,byakuinss/spark,JerryLead/spark,publicRoman/spark,mahak/spark,mzl9039/spark,Panos-Bletsos/spark-cost-model-optimizer,wangyum/spark,JerryLead/spark,tengpeng/spark,zuotingbing/spark,cloud-fan/spark,ibm-research-ireland/sparkoscope,apache/spark,milliman/spark,shubhamchopra/spark,publicRoman/spark,BryanCutler/spark,WindCanDie/spark,ericvandenbergfb/spark,jrshust/spark,byakuinss/spark,shubhamchopra/spark,jlopezmalla/spark,joseph-torres/spark,vinodkc/spark,mike0sv/spark,SnappyDataInc/spark,lvdongr/spark,lxsmnv/spark,ericvandenbergfb/spark,zhouyejoe/spark,mike0sv/spark,Aegeaner/spark,facaiy/spark,poffuomo/spark,poffuomo/spark,WindCanDie/spark,mdespriee/spark,tejasapatil/spark,goldmedal/spark,zuotingbing/spark,vinodkc/spark,HyukjinKwon/spark,narahari92/spark,chuckchen/spark,liutang123/spark,mahak/spark,HyukjinKwon/spark