@@ -317,7 +317,9 @@ func parseGitRefs(oldRef, newRef string) (string, string, error) {
317317 return oldRef , newRef , nil
318318}
319319
320- func buildBenches (ctx context.Context , pkgFilter []string , postChck string , bss ... * benchSuite ) error {
320+ func buildBenches (
321+ ctx context.Context , pkgFilter []string , postChck string , bss ... * benchSuite ,
322+ ) error {
321323 // Get the current branch so we can revert to it after, if possible.
322324 if ref , ok , err := getCurSymbolicRef (); err != nil {
323325 return err
@@ -596,9 +598,7 @@ func processBenchOutput(
596598 return tables , nil
597599}
598600
599- func logProfileLocations (
600- bs1 , bs2 * benchSuite , cpuProfile , memProfile , mutexProfile bool ,
601- ) {
601+ func logProfileLocations (bs1 , bs2 * benchSuite , cpuProfile , memProfile , mutexProfile bool ) {
602602 if ! cpuProfile && ! memProfile && ! mutexProfile {
603603 return
604604 }
@@ -712,7 +712,14 @@ func (bs *benchSuite) build(pkgFilter []string, postChck string, t time.Time) (e
712712 }
713713 bs .testFiles [f .Name ()] = struct {}{}
714714 }
715- return nil
715+ if len (bs .testFiles ) > 0 {
716+ return nil
717+ }
718+ // The bin directory exists but contains no test binaries. This can
719+ // happen if a previous build was interrupted. Remove it and rebuild.
720+ if err := os .RemoveAll (bs .binDir ); err != nil {
721+ return err
722+ }
716723 } else if ! os .IsNotExist (err ) {
717724 return errors .Wrap (err , "looking for test directory" )
718725 }
0 commit comments