Commit d30591c1 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

cmd/vendor/github.com/google/pprof: cherry-pick fix to cope with $HOME not being writable

Upstream PRs: https://github.com/google/pprof/pull/305,
https://github.com/google/pprof/pull/306.

Change-Id: I28969118f52ee08fcaf3572ad5da015ae756fd7a
Reviewed-on: https://go-review.googlesource.com/90935
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent bcc86d5f
...@@ -362,6 +362,18 @@ func TestHttpsInsecure(t *testing.T) { ...@@ -362,6 +362,18 @@ func TestHttpsInsecure(t *testing.T) {
if runtime.GOOS == "nacl" { if runtime.GOOS == "nacl" {
t.Skip("test assumes tcp available") t.Skip("test assumes tcp available")
} }
saveHome := os.Getenv(homeEnv())
tempdir, err := ioutil.TempDir("", "home")
if err != nil {
t.Fatal("creating temp dir: ", err)
}
defer os.RemoveAll(tempdir)
// pprof writes to $HOME/pprof by default which is not necessarily
// writeable (e.g. on a Debian buildd) so set $HOME to something we
// know we can write to for the duration of the test.
os.Setenv(homeEnv(), tempdir)
defer os.Setenv(homeEnv(), saveHome)
baseVars := pprofVariables baseVars := pprofVariables
pprofVariables = baseVars.makeCopy() pprofVariables = baseVars.makeCopy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment