From 554d38a8639e404e955c6c1a2f038335d2d56e9f Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sat, 23 Mar 2024 17:20:50 -0400 Subject: [PATCH] test: get to passing on JRuby - update error message - avoid race condition on cookie expiration --- test/helper.rb | 2 +- test/test_http_cookie_jar.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index 6b463ad..1e1a514 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -50,6 +50,6 @@ end def sleep_until(time) if (s = time - Time.now) > 0 - sleep s + sleep s + 0.01 end end diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index 969ee7f..e59c018 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -10,10 +10,8 @@ module TestHTTPCookieJar end def test_nonexistent_store_in_config - assert_raise_with_message( - ArgumentError, - /cookie store unavailable: :nonexistent, error: cannot load .*nonexistent_store/ - ) { + expected = /cookie store unavailable: :nonexistent, error: (cannot load|no such file to load) .*nonexistent_store/ + assert_raise_with_message(ArgumentError, expected) { HTTP::CookieJar.new(store: :nonexistent) } end