Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/driver: skip TestHttpsInsecure test on iOS #256

Merged
merged 1 commit into from Nov 8, 2017

Conversation

eliasnaur
Copy link

Also, replace a PrintErr with Print to avoid a warning message
being registered as an error.

This will in turn fix golang.org/issues/22612 for the Go iOS
builders.

@codecov-io
Copy link

codecov-io commented Nov 7, 2017

Codecov Report

Merging #256 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #256   +/-   ##
=======================================
  Coverage   65.38%   65.38%           
=======================================
  Files          34       34           
  Lines        7173     7173           
=======================================
  Hits         4690     4690           
  Misses       2088     2088           
  Partials      395      395
Impacted Files Coverage Δ
internal/driver/fetch.go 68.26% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79c4198...40c2029. Read the comment docs.

@eliasnaur
Copy link
Author

I haven't contributed to this repository before, but fwiw the Travis failures doesn't seem related to this PR.

// CPU profiling is not supported on Plan9; see golang.org/issues/22564.
return
case "darwin":
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
// CPU profiling is not supported on OS; see golang.org/issues/22612.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is CPU profiling not supported on iOS in the same way as on plan9, or the quality of profiles is low and there are no symbolized function names in the profile? Looking at https://github.com/golang/go/blob/83a1a2ba63cd79ed65a97bead2c31ef0753f4cd2/src/runtime/pprof/pprof_test.go#L148, I don't see the CPU profile test being skipped in the Go tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think CPU profiling works on iOS, so my guess would be missing symbols, judging from the failure log:

Local symbolization failed for cppbench_server_main: stat cppbench_server_main: no such file or directory
Local symbolization failed for libpthread-2.15.so: stat /libpthread-2.15.so: no such file or directory
Some binary filenames not available. Symbolization may be incomplete.
Try setting PPROF_BINARY_PATH to the search path for local binaries.
Local symbolization failed for cppbench_server_main: stat cppbench_server_main: no such file or directory
Local symbolization failed for libpthread-2.15.so: stat /libpthread-2.15.so: no such file or directory
Some binary filenames not available. Symbolization may be incomplete.
Try setting PPROF_BINARY_PATH to the search path for local binaries.
Local symbolization failed for cppbench_server_main: stat cppbench_server_main: no such file or directory
Local symbolization failed for libpthread-2.15.so: stat /libpthread-2.15.so: no such file or directory
Some binary filenames not available. Symbolization may be incomplete.
Try setting PPROF_BINARY_PATH to the search path for local binaries.

I updated the comment to reflect that.

@@ -294,7 +294,7 @@ func setTmpDir(ui plugin.UI) (string, error) {
dirs = append(dirs, os.TempDir())
for _, tmpDir := range dirs {
if err := os.MkdirAll(tmpDir, 0755); err != nil {
ui.PrintErr("Could not use temp dir ", tmpDir, ": ", err.Error())
ui.Print("Could not use temp dir ", tmpDir, ": ", err.Error())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's the right way to fix the single test on a single platform, as it changes the behavior globally.

You can conditionally (for the problematic environment only) add a pattern to ignore in the configuration of the TestUI in the test,

UI: &proftest.TestUI{T: t, AllowRx: "Saved profile in"},
which should be sufficient.

I also wonder if the

proftest.go:114: Could not use temp dir /private/var/mobile/Containers/Data/Application/2B578AA2-4677-47C6-8665-DDB9509D5C92/pprof: mkdir /private/var/mobile/Containers/Data/Application/2B578AA2-4677-47C6-8665-DDB9509D5C92/pprof: operation not permitted

message from the test represents a real issue with temporary directory location on iOS. That can be handled separately though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTmpDir tries $HOME/pprof first before os.TempDir. On iOS $HOME is the base directory of the installed app and isn't writable so I assumed the "Could not use temp dir" should be a warning, not an error.

However, I changed the PrintErr back and made your suggested change to the ignore pattern.

// CPU profiling is not supported on Plan9; see golang.org/issues/22564.
return
case "darwin":
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
// CPU profiling is not supported on OS; see golang.org/issues/22612.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a more useful bug to link, the one which actually tracks the profiling issue on iOS rather than points to the pprof's test breakage? Like we list golang.org/issues/22564 for Plan9.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my comment above, I don't there is an issue with the basic CPU profiling machinery on iOS.

This will in turn fix golang.org/issues/22612 for the Go iOS
builders.
@eliasnaur
Copy link
Author

I've amended the PR to match your comments and suggestions. Sorry for the drive-by nature of this; I'm trying to get the Go iOS builder green again after refreshing the vendored copy of this package but I know very little about this package (nor the runtime/pprof package).

@aalexand
Copy link
Collaborator

aalexand commented Nov 8, 2017

The https://travis-ci.org/google/pprof/jobs/299036158 failure is unrelated, it's #255

@aalexand aalexand merged commit 9e20b5b into google:master Nov 8, 2017
gmarin13 pushed a commit to gmarin13/pprof that referenced this pull request Dec 17, 2020
This will in turn fix golang.org/issues/22612 for the Go iOS
builders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants