Skip to content

Commit d97bd6c

Browse files
author
Jan Kunzmann
committed
check-mysql-replication-status: test lag outlier reporting
1 parent 4127a49 commit d97bd6c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/check-mysql-replication-status_spec.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ def checker.critical(*_args)
7979
end
8080

8181
[
82-
[0, 0, 'ok'],
83-
[99_999, 2, 'critical'],
82+
[0, :ok, 0, 'ok'],
83+
[99_999, :ok, 2, 'critical'],
84+
[0, :critical, 2, 'critical'],
8485
].each do |testdata|
85-
it "sleeps with lag outlier protection and returns #{testdata[2]} for default thresholds" do
86+
it "sleeps with lag outlier protection and returns #{testdata[3]} (using default threshold)" do
8687
checker.config[:lag_outlier_retry] = 1
8788
checker.config[:lag_outlier_sleep] = 10
89+
checker.config[:lag_outlier_report] = testdata[1]
8890

8991
slave_status_row = [
9092
{
@@ -113,7 +115,7 @@ def checker.critical(*_args)
113115
rescue SystemExit => e
114116
exit_code = e.status
115117
end
116-
expect(exit_code).to eq testdata[1]
118+
expect(exit_code).to eq testdata[2]
117119
end
118120
end
119121
end

0 commit comments

Comments
 (0)