Files
ubicloud/lib/monitorable_resource.rb
Daniel Farina 2a6d046c75 Fix modulus on nil rpt value crash in monitor
I ran across this while working with the questionably broad `rescue`
in `MonitorableResource#check_pulse`.  Perhaps that rescue should be
less inclusive of things like "no such method" exceptions and crash
instead.

The test that provokes it is:

    describe "#check_pulse" do
      it "calls check_pulse on resource and sets pulse" do
        expect(postgres_server).to receive(:check_pulse).and_return({reading: "up"})
        expect { r_w_event_loop.check_pulse }.to change { r_w_event_loop.instance_variable_get(:@pulse) }.from({}).to({reading: "up"})
      end

The exception is:

    #<NoMethodError: undefined method '%' for nil>
2025-07-31 13:30:45 -07:00

2.0 KiB