Skip to content

Commit 08cd427

Browse files
committed
test: Widen the sync lock deadline budget
One 0.25 s deadline covered two steps: the actor start and the lock wait under test. When a slow CI runner took more than 0.25 s to start the actor, the call timed out before the actor ran, and the test waited 2 s for it at line 422. This failed the Rails 7.1 compatibility job in run 36877758705. Give the call 1 s, and set the outer limits to 3 s and 2 s. A 0.3 s stall before the actor claim reproduced the CI error with the old budget; with the new budget, 0.3 s and 0.6 s stalls pass. The limits stay below the 5 s SQLite busy timeout: when the deadline never expires, the test fails at line 443 on Rails 7.1 and 8.1.
1 parent e675248 commit 08cd427

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/integration/synchronous_invocation_test.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def wait(timeout:)
415415
result = Queue.new
416416
invocation = Thread.new do
417417
result << capture_exception do
418-
SolidObjects::SynchronousInvocation.new.call(message_reference, timeout: 0.25)
418+
SolidObjects::SynchronousInvocation.new.call(message_reference, timeout: 1)
419419
end
420420
end
421421

@@ -440,11 +440,11 @@ def wait(timeout:)
440440

441441
started_at = monotonic_now
442442
DeadlineActor.continue << true
443-
error = Timeout.timeout(2) { result.pop }
443+
error = Timeout.timeout(3) { result.pop }
444444
elapsed = monotonic_now - started_at
445445

446446
assert_instance_of SolidObjects::SyncTimeout, error
447-
assert_operator elapsed, :<, 1.5
447+
assert_operator elapsed, :<, 2
448448
assert_equal message_reference.id, error.message_id
449449
ensure
450450
DeadlineActor.continue << true if invocation&.alive?

0 commit comments

Comments
 (0)