test-prof / test-prof

Ruby Tests Profiling Toolbox
https://test-prof.evilmartians.io/
MIT License
1.89k stars 155 forks source link

Stackprof Flamegraph Not Loading #193

Closed ecbrodie closed 4 years ago

ecbrodie commented 4 years ago

Tell us about your environment

Ruby Version: 2.6.6

Framework Version (RSpec, Minitest, FactoryGirl, Rails, whatever): Rspec

TestProf Version: 0.11.3

What did you do?

I am attempting to run TestProf to profile my test suite via the StackProf integration. So, I installed the latest version of both StackProf and TestProf in my project. Gemfile:

group :test do
  gem "stackprof", require: false
  gem "test-prof"
end

I then ran an rspec test file with profiling enabled:

export TEST_STACK_PROF=1
bin/rspec spec/some_spec.rb

I followed the output from this command to generate the open command to flamegraph.

What did you expect to happen?

Framegraph opens on my browser (Chrome) without any issue.

What actually happened?

Nothing loads! I do see the page title as "Flamegraph", but there is no content. I have ensured that any ad blocker I have is disabled. I also tried on Incognito and also Safari. Still nothing loads.

palkan commented 4 years ago

What StackProf version do you use?

Could you please share the logs of the test run related to TestProf? Also, would be great if you can share the resulting StackProf generated report file.

ThomasHarper commented 4 years ago

Hello @palkan,

I've got the same issue as @ecbrodie reported. Sadly I can not share the generated dump as it is over 150mb.

Ruby Version: 2.7.1

Framework Version : Minitest (5.14)

TestProf Version: 0.12.0

ecbrodie commented 4 years ago

Hi @palkan

I never had time to respond. I also don't really have time right now to dig into this further, got a lot of other competing duties going on at work.

I'll just say that I'm trying to do you a solid by reporting in this issue. I'm sure you can easily reproduce this by bootstrapping a new Rails project and attempting to run testprof + stackprof on it. I used whatever stackprof version was the latest on the day that I reported it (you can refer to RubyGems to find out the versions).

I'm not going to check in to this issue any further. I leave it up to you as to whether you wish to investigate a legitimate bug on your tool. Until then, sounds like testprof+stackprof is not a usable tool for my project. Thank you for your earlier reply and any future help you provide here.

palkan commented 4 years ago

@ThomasHarper

the generated dump as it is over 150mb.

Hm, that could be the reason: browser is getting stuck trying to digest it.

It's not recommended to profile the whole test suite with RubyProf/StackProf, since the generated report could be too huge to work with. That's why we have a tests sampling feature.

A few times I saw stackprof generated corrupted HTML reports (with invalid JS in it). Checking the browser logs for errors could provide some useful information.

@ecbrodie

I'm sure you can easily reproduce this by bootstrapping a new Rails project and attempting to run testprof + stackprof on it

Well, it's not reproducible this way: everything works as expected 🤷🏻‍♂️