Skip to content

Commit 7605783

Browse files
more test fixing
1 parent c982ada commit 7605783

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/pid_controller_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,19 @@ def test_rejection_rate_decreases_with_successful_pings
115115

116116
time_travel(1.0) do
117117
@controller.update
118-
end
119-
initial_rejection = @controller.rejection_rate
120118

121-
# Now simulate successful pings and lower error rate
122-
10.times { @controller.record_request(:success) }
123-
5.times { @controller.record_ping(:success) }
119+
initial_rejection = @controller.rejection_rate
124120

125-
time_travel(1.0) do
126-
@controller.update
127-
end
121+
# Now simulate successful pings and lower error rate
122+
10.times { @controller.record_request(:success) }
123+
5.times { @controller.record_ping(:success) }
128124

129-
# Rejection rate should decrease
130-
assert_operator(@controller.rejection_rate, :<, initial_rejection)
125+
time_travel(1.0) do
126+
@controller.update
127+
128+
assert_operator(@controller.rejection_rate, :<, initial_rejection)
129+
end
130+
end
131131
end
132132

133133
def test_rejection_rate_clamped_between_0_and_1

0 commit comments

Comments
 (0)