Skip to content

Commit

Permalink
Merge pull request #204 from Fryguy/fix_sporadic_test_failure
Browse files Browse the repository at this point in the history
Fix sporadic test failure

(cherry picked from commit f43972a)
  • Loading branch information
agrare authored and jrafanie committed Jun 30, 2023
1 parent 93e78c9 commit 4db9ba0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/manageiq/appliance_console/database_replication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def run_repmgr_command(cmd, params = {})
end
end

Process.wait(pid)
$CHILD_STATUS.success?
pid, status = Process.wait2(pid)
status.success?
end

def primary_connection_hash
Expand Down
2 changes: 2 additions & 0 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@
let(:replication_standby) { ManageIQ::ApplianceConsole::DatabaseReplicationStandby.new }

before do
pending "does not work on macOS because `ip` command is not available" if RUBY_PLATFORM.match?(/darwin/)

allow(ManageIQ::ApplianceConsole::DatabaseReplicationPrimary).to receive(:new).and_return(replication_primary)
allow(ManageIQ::ApplianceConsole::DatabaseReplicationStandby).to receive(:new).and_return(replication_standby)
end
Expand Down
3 changes: 2 additions & 1 deletion spec/database_replication_standby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@
}
]

expect(Process).to receive(:wait).with(1234)
expect(Process).to receive(:wait2).with(1234).and_return([1234, double(:success? => true)])
expect(AwesomeSpawn).to receive(:run!).with(*run_args).and_return(double(:output => "success"))

expect(subject.register_standby_server).to be true
end
end
Expand Down

0 comments on commit 4db9ba0

Please sign in to comment.