Skip to content

Commit 514e5a1

Browse files
committed
🔧 minitest-retry
1 parent 16aa61d commit 514e5a1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

test/functional/masq/sessions_controller_test.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_should_redirect_to_users_identity_page_after_successful_login
1515
assert_redirected_to(identity_url(account, host: Masq::Engine.config.masq["host"]))
1616
end
1717

18-
def test_should_redirect_to_users_on_login_if_allready_logged_in
18+
def test_should_redirect_to_users_on_login_if_already_logged_in
1919
login_as(:standard)
2020
account = accounts(:standard)
2121
get(:new)
@@ -123,6 +123,9 @@ def test_should_authenticate_with_password_and_yubico_otp
123123
yubico_otp = @account.yubico_identity + "x" * 32
124124
Account.expects(:verify_yubico_otp).with(yubico_otp).returns(true)
125125
post(:create, params: {login: @account.login, password: "test" + yubico_otp})
126+
# TODO: Why does the account save seems to be very slow sometimes?
127+
# Or is it failing to save the account randomly?
128+
sleep(1)
126129
@account.reload
127130
assert_not_nil(@account.last_authenticated_at)
128131
assert(@account.last_authenticated_by_yubikey)

test/test_helper.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99

1010
Minitest::Retry.use!(
1111
retry_count: 3, # The number of times to retry. The default is 3.
12-
verbose: true, # Whether or not to display the message at the time of retry. The default is true.
12+
verbose: true, # Whether to display the message at the time of retry. The default is true.
1313
io: $stdout, # Display destination of retry when the message. The default is stdout.
1414
exceptions_to_retry: [], # List of exceptions that will trigger a retry (when empty, all exceptions will).
15-
methods_to_retry: [
16-
:test_should_authenticate_with_password_and_yubico_otp,
17-
], # List of methods that will trigger a retry (when empty, all methods will).
15+
methods_to_retry: [], # List of methods that will trigger a retry (when empty, all methods will).
1816
classes_to_retry: [], # List of classes that will trigger a retry (when empty, all classes will).
1917
methods_to_skip: [], # List of methods that will skip a retry (when empty, all methods will retry).
2018
exceptions_to_skip: [], # List of exceptions that will skip a retry (when empty, all exceptions will retry).

0 commit comments

Comments
 (0)