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

ManageIQ / manageiq / 57475 / 8
49%
master: 63%

Build:
Build:
LAST BUILD BRANCH: kasparov
DEFAULT BRANCH: master
Ran 26 Apr 2017 02:14AM UTC
Files 11
Run time 0s
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

26 Apr 2017 02:12AM UTC coverage: 92.803%. Remained the same
2.2.5, GEM=manageiq_foreman

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

245 of 264 relevant lines covered (92.8%)

2.79 hits per line

Source Files on job 57475.8 (2.2.5, GEM=manageiq_foreman)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 57475
  • Travis Job 57475.8
  • 93ceb0d2 on github
  • Prev Job for 2.2.5, GEM=manageiq_foreman on darga (#57260.8)
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