There seems to be a race condition between thenot_after attribute in OpenSSL::X509::Certificate and the execution that is causing the tests to be flaky.
Why
As I mentioned in the original discussion, the problem is that when we create a certificate, we make it that is only valid for just 60 seconds. Therefore, if the execution takes longer than 60 seconds for checking if the certificate is valid, eventually the certificate will be considered invalid.
What
There seems to be a race condition between the
not_after
attribute inOpenSSL::X509::Certificate
and the execution that is causing the tests to be flaky.Why
As I mentioned in the original discussion, the problem is that when we create a certificate, we make it that is only valid for just 60 seconds. Therefore, if the execution takes longer than 60 seconds for checking if the certificate is valid, eventually the certificate will be considered invalid.
Backtrace
aik_certificate.conformant?
returnsfalse
in_use?
now < not_after
returnsfalse
How
To fix this, I decided to double the time in which a certificate is considered valid.