Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos-latest truffeeruby-head: test_basic_response_response_operations failing #695

Closed
junaruga opened this issue Nov 16, 2023 · 3 comments · Fixed by #702
Closed

macos-latest truffeeruby-head: test_basic_response_response_operations failing #695

junaruga opened this issue Nov 16, 2023 · 3 comments · Fixed by #702

Comments

@junaruga
Copy link
Member

I faced the following failure in macos-latest truffeeruby-head at #694. The PR is not related to this failure.

https://github.com/ruby/openssl/actions/runs/6894315128/job/18755841590?pr=694#step:9:611

1) Failure: test_basic_response_response_operations(OpenSSL::TestOCSP):
  <2023-11-16 17:26:22 +0000> -/+ <1> was expected to include
  <2023-11-16 17:26:24 UTC>.
  
  Relation:
  <<2023-11-16 17:26:22 +0000>-<1>[2023-11-16 17:26:21 +0000] <= <2023-11-16 17:26:22 +0000>+<1>[2023-11-16 17:26:23 +0000] < <2023-11-16 17:26:24 UTC>>
/Users/runner/work/openssl/openssl/test/openssl/test_ocsp.rb:231:in `test_basic_response_response_operations'
     228:     assert_equal OpenSSL::OCSP::V_CERTSTATUS_REVOKED, single.cert_status
     229:     assert_equal OpenSSL::OCSP::REVOKED_STATUS_UNSPECIFIED, single.revocation_reason
     230:     assert_equal now - 400, single.revocation_time
  => 231:     assert_in_delta (now - 301), single.this_update, 1
     232:     assert_equal nil, single.next_update
     233:     assert_equal [], single.extensions
     234: 
<internal:core> core/throw_catch.rb:36:in `catch'
<internal:core> core/throw_catch.rb:36:in `catch'
@junaruga
Copy link
Member Author

It seems the failure can randomly happen.

I don't see the failure with the same commit in GitHub Actions in my forked repository.
https://github.com/junaruga/ruby-openssl/actions/runs/6894314649

@rhenium
Copy link
Member

rhenium commented Nov 25, 2023

The test case:

    now = Time.at(Time.now.to_i)
    bres.add_status(cid1, OpenSSL::OCSP::V_CERTSTATUS_REVOKED, OpenSSL::OCSP::REVOKED_STATUS_UNSPECIFIED, now - 400, -300, 

    assert_in_delta (now - 301), single.this_update, 1

This does seem to be problematic. This test case fails if the clock advances by a second between the first line and the second line.

rhenium added a commit to rhenium/ruby-openssl that referenced this issue Nov 25, 2023
@junaruga
Copy link
Member Author

junaruga commented Dec 3, 2023

Oh I see. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants