Browse Source

Make pprof driver tests less noisy. (#349)

Alexey Alexandrov 7 years ago
parent
commit
6084089963
No account linked to committer's email address
2 changed files with 5 additions and 3 deletions
  1. 4
    2
      internal/driver/fetch_test.go
  2. 1
    1
      internal/proftest/proftest.go

+ 4
- 2
internal/driver/fetch_test.go View File

283
 			}
283
 			}
284
 			f.args = tc.sources
284
 			f.args = tc.sources
285
 
285
 
286
-			o := setDefaults(nil)
287
-			o.Flagset = f
286
+			o := setDefaults(&plugin.Options{
287
+				UI:      &proftest.TestUI{T: t, AllowRx: "Local symbolization failed|Some binary filenames not available"},
288
+				Flagset: f,
289
+			})
288
 			src, _, err := parseFlags(o)
290
 			src, _, err := parseFlags(o)
289
 
291
 
290
 			if err != nil {
292
 			if err != nil {

+ 1
- 1
internal/proftest/proftest.go View File

122
 	// implementation does. Without this Error() calls fmt.Sprintln() which
122
 	// implementation does. Without this Error() calls fmt.Sprintln() which
123
 	// _always_ adds spaces between arguments, unlike fmt.Sprint() which only
123
 	// _always_ adds spaces between arguments, unlike fmt.Sprint() which only
124
 	// adds them between arguments if neither is string.
124
 	// adds them between arguments if neither is string.
125
-	ui.T.Error(fmt.Sprint(args...))
125
+	ui.T.Error("unexpected error: " + fmt.Sprint(args...))
126
 }
126
 }
127
 
127
 
128
 // IsTerminal indicates if the UI is an interactive terminal.
128
 // IsTerminal indicates if the UI is an interactive terminal.