-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-8144. TestDefaultCertificateClient#testTimeBeforeExpiryGracePeriod fails as we approach DST. #4382
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
Conversation
…od() test fails as we approach DST.
| Date expireDate = certificate.getNotAfter(); | ||
| LocalDateTime gracePeriodStart = expireDate.toInstant() | ||
| .atZone(ZoneId.systemDefault()).toLocalDateTime().minus(gracePeriod); | ||
| .minus(gracePeriod).atZone(ZoneId.systemDefault()).toLocalDateTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same logic appears in CertificateClientTestImpl, should be fixed there, too?
Lines 158 to 159 in 111161d
| LocalDateTime gracePeriodStart = expireDate.toInstant() | |
| .atZone(ZoneId.systemDefault()).toLocalDateTime().minus(gracePeriod); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you @adoroszlai for spotting this one.
In general this one did not caused a problem, as this implementation is used with functionality that does not happen around certificate renewal, and where it does, the grace period is a few seconds, so if it remains this way it does not cause trouble just for very short periods of time, so probably we would not recognize it, but nonetheless, I have pushed the change to the test class in a follow up commit.
Galsza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* master: (262 commits) HDDS-8153. Integrate ContainerBalancer with MoveManager (apache#4391) HDDS-8090. When getBlock from a datanode fails, retry other datanodes. (apache#4357) HDDS-8163 Use try-with-resources to ensure close rockdb connection in SstFilteringService (apache#4402) HDDS-8065. Provide GNU long options (apache#4394) HDDS-7930. [addendum] input stream does not refresh expired block token. HDDS-7930. input stream does not refresh expired block token. (apache#4378) HDDS-7740. [Snapshot] Implement SnapshotDeletingService (apache#4244) HDDS-8076. Use container cache in Key listing API. (apache#4346) HDDS-8091. [addendum] Generate list of config tags from ConfigTag enum - Hadoop 3.1 compatibility fix (apache#4374) HDDS-8144. TestDefaultCertificateClient#testTimeBeforeExpiryGracePeriod fails as we approach DST. (apache#4382) HDDS-8151. Support fine grained lifetime for root CA certificate (apache#4386) HDDS-8150. RpcClientTest and ConfigurationSourceTest not run due to naming convention (apache#4388) HDDS-8131. Add Configuration for OM Ratis Log Purge Tuning Parameters. (apache#4371) HDDS-8133. Create ozone sh key checksum command (apache#4375) HDDS-8142. Check if no entries in Block DB for a container on container delete (apache#4379) HDDS-8118. Fail container delete on non empty chunks dir (apache#4367) HDDS-8028. JNI for RocksDB SST Dump tool (apache#4315) HDDS-8129. ContainerStateMachine allows two different tasks with the same container id running in parallel. (apache#4370) HDDS-8119. Remove loosely related AutoCloseable from SendContainerOutputStream (apache#4368) close db connection (apache#4366) ...
What changes were proposed in this pull request?
In my local environment the TestDefaultCertificateClient#testTimeBeforeExpiryGracePeriod() test started to fail, as we are approaching DST, and with that the return value of DefaultCertificateClient#timeBeforeExpiryGracePeriod(X509Certificate) is off by an hour.
This is because the test sets a 28 days expiration to the certificate, but due to switch to DST, at 3am in one of the mornings we switch to 2am, therefore the certificate expiration is 28days and 1 hour away instead of the expected 0.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8144
How was this patch tested?
After the change the named test runs fine in my local env.