@@ -257,6 +257,8 @@ func TestRun(t *testing.T) {
257257
258258 for _ , tc := range testCases {
259259 t .Run (tc .name , func (t * testing.T ) {
260+ t .Parallel ()
261+
260262 testResults , err := tc .runner .RunTestPackages ([]string {flakyTestPackagePath })
261263 require .NoError (t , err )
262264
@@ -543,9 +545,36 @@ func TestAttributePanicToTest(t *testing.T) {
543545 },
544546 },
545547 {
546- name : "no test name in panic " ,
547- expectedTestName : "UnknownTestPanic " ,
548+ name : "empty " ,
549+ expectedTestName : "" ,
548550 expectedTimeout : false ,
551+ outputs : []string {},
552+ },
553+ }
554+
555+ for _ , tc := range testCases {
556+ t .Run (tc .name , func (t * testing.T ) {
557+ testName , timeout , err := attributePanicToTest (tc .outputs )
558+ assert .Equal (t , tc .expectedTimeout , timeout , "timeout flag mismatch" )
559+ if tc .expectedTestName == "" {
560+ require .Error (t , err )
561+ } else {
562+ require .NoError (t , err )
563+ assert .Equal (t , tc .expectedTestName , testName , "test name mismatch" )
564+ }
565+ })
566+ }
567+ }
568+
569+ func TestFailToAttributePanicToTest (t * testing.T ) {
570+ t .Parallel ()
571+
572+ testCases := []struct {
573+ name string
574+ outputs []string
575+ }{
576+ {
577+ name : "no test name in panic" ,
549578 outputs : []string {
550579 "panic: reflect: Elem of invalid type bool" ,
551580 "goroutine 104182 [running]:" ,
@@ -582,24 +611,14 @@ func TestAttributePanicToTest(t *testing.T) {
582611 "FAIL\t github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana\t 184.801s" ,
583612 },
584613 },
585- {
586- name : "empty" ,
587- expectedTestName : "" ,
588- expectedTimeout : false ,
589- outputs : []string {},
590- },
591614 }
592615
593616 for _ , tc := range testCases {
594617 t .Run (tc .name , func (t * testing.T ) {
595618 testName , timeout , err := attributePanicToTest (tc .outputs )
596- assert .Equal (t , tc .expectedTimeout , timeout , "timeout flag mismatch" )
597- if tc .expectedTestName == "" {
598- require .Error (t , err )
599- } else {
600- require .NoError (t , err )
601- assert .Equal (t , tc .expectedTestName , testName , "test name mismatch" )
602- }
619+ require .Error (t , err )
620+ assert .Empty (t , testName , "test name should be empty" )
621+ assert .False (t , timeout , "timeout flag should be false" )
603622 })
604623 }
605624}
0 commit comments