• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ManageIQ / manageiq / 57475
49%
master: 63%

Build:
Build:
LAST BUILD BRANCH: kasparov
DEFAULT BRANCH: master
Ran 26 Apr 2017 02:14AM UTC
Jobs 7
Files 2946
Run time 41min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
57475

Pull #14891

travis-ci

web-flow
Use pid + thread id to index into the benchmark results

https://bugzilla.redhat.com/show_bug.cgi?id=1424716

Note: This is a manual backport of:
https://github.com/ManageIQ/manageiq-gems-pending/pull/139

Forks inherit the @@realtime_by_tid and parent/child Thread.current.object_id
are equal, so we need to index into the hash with the pid too.

The following test recreates and verifies this change but because it
forks and doesn't properly bubble up exit codes, I wrote it just to
confirm the problem.

```ruby
  it "doesn't get parent's realtime_block in forked child" do
    p1_result, p1_timings = Benchmark.realtime_block(:parent_task1) do
      Timecop.travel(1000)
      p2_result, p2_timings = Benchmark.realtime_block(:parent_task2) do
        Timecop.travel(500)
      end

      expect(p2_timings[:parent_task2]).to be_within(0.5).of(500)
      expect(p2_timings.keys).to eq([:parent_task2])

      pid = fork do
        c_result, c_timings = Benchmark.realtime_block(:child_task) do
          Timecop.travel(250)
        end
        expect(c_timings[:child_task]).to be_within(0.5).of(250)
        expect(c_timings.keys).to eq([:child_task])
      end
    end

    expect(p1_timings[:parent_task1]).to be_within(0.5).of(1500)
    expect(p1_timings.keys.sort).to eq([:parent_task1, :parent_task2])
  end
```

The tests pass because I'm not handling exit codes properly, but I
see the expectation error pop up when I roll back my code change:

```
/Users/joerafaniello/.gem/ruby/2.3.4/gems/rspec-support-3.5.0/lib/rspec/support.rb:87:in
`block in <module:Support>':
(RSpec::Expectations::ExpectationNotMetError)
expected: [:child_task]
     got: [:parent_task2, :child_task]

     (compared using ==)

     Diff:
     @@ -1,2 +1,2 @@
     -[:child_task]
     +[:parent_task2, :child_task]
```
Pull Request #14891: [DARGA] Use pid + thread id to index into the benchmark results

88344 of 256436 relevant lines covered (34.45%)

155.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 57475.1 (2.2.5, TEST_SUITE=vmdb) 26 Apr 2017 02:52AM UTC 0
57.78
Travis Job 57475.1
2 57475.2 (2.2.5, TEST_SUITE=automation) 26 Apr 2017 02:20AM UTC 0
8.36
Travis Job 57475.2
3 57475.3 (2.2.5, TEST_SUITE=migrations) 26 Apr 2017 02:18AM UTC 0
2.09
Travis Job 57475.3
5 57475.5 (2.2.5, TEST_SUITE=replication) 26 Apr 2017 02:15AM UTC 0
3.48
Travis Job 57475.5
6 57475.6 (2.2.5, GEM=pending) 26 Apr 2017 02:16AM UTC 0
39.44
Travis Job 57475.6
8 57475.8 (2.2.5, GEM=manageiq_foreman) 26 Apr 2017 02:14AM UTC 0
92.8
Travis Job 57475.8
9 57475.9 (2.2.5, TEST_SUITE=manageiq-providers-amazon) 26 Apr 2017 02:15AM UTC 0
7.38
Travis Job 57475.9
Source Files on build 57475
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #57475
  • Pull Request #14891
  • PR Base - darga (#57260)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc