@@ -48,7 +48,7 @@ class Sample < ActiveRecord::Base
48
48
Sample . transaction ( requires_new : true ) do
49
49
assert_current_transaction_is_savepoint_transaction
50
50
s1 . lock!
51
- barrier . wait
51
+ barrier . wait ( 30 )
52
52
s2 . update value : 1
53
53
end
54
54
end
@@ -60,7 +60,7 @@ class Sample < ActiveRecord::Base
60
60
Sample . transaction ( requires_new : true ) do
61
61
assert_current_transaction_is_savepoint_transaction
62
62
s2 . lock!
63
- barrier . wait
63
+ barrier . wait ( 30 )
64
64
s1 . update value : 2
65
65
end
66
66
end
@@ -91,7 +91,7 @@ class Sample < ActiveRecord::Base
91
91
Sample . transaction ( requires_new : true ) do
92
92
assert_current_transaction_is_savepoint_transaction
93
93
s1 . lock!
94
- barrier . wait
94
+ barrier . wait ( 30 )
95
95
s2 . update value : 4
96
96
97
97
rescue ActiveRecord ::Deadlocked
@@ -113,7 +113,7 @@ class Sample < ActiveRecord::Base
113
113
Sample . transaction ( requires_new : true ) do
114
114
assert_current_transaction_is_savepoint_transaction
115
115
s2 . lock!
116
- barrier . wait
116
+ barrier . wait ( 30 )
117
117
s1 . update value : 3
118
118
rescue ActiveRecord ::Deadlocked
119
119
deadlocks += 1
@@ -143,7 +143,7 @@ class Sample < ActiveRecord::Base
143
143
Sample . transaction ( requires_new : true ) do
144
144
assert_current_transaction_is_savepoint_transaction
145
145
s1 . lock!
146
- barrier . wait
146
+ barrier . wait ( 30 )
147
147
s2 . update value : 4
148
148
end
149
149
rescue ActiveRecord ::Deadlocked
@@ -160,7 +160,7 @@ class Sample < ActiveRecord::Base
160
160
Sample . transaction ( requires_new : true ) do
161
161
assert_current_transaction_is_savepoint_transaction
162
162
s2 . lock!
163
- barrier . wait
163
+ barrier . wait ( 30 )
164
164
s1 . update value : 3
165
165
end
166
166
rescue ActiveRecord ::Deadlocked
0 commit comments