Skip to content

Conversation

@symious
Copy link
Contributor

@symious symious commented Jan 24, 2021

What changes were proposed in this pull request?

  • Set the token expiration to a past time.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-4736

How was this patch tested?

Manual test.

Comment on lines 331 to 333
IllegalStateException, IOException, OperatorCreationException {
Date from = new Date();
Date from = new Date(Instant.now().toEpochMilli() - 100L);
Date to = new Date(from.getTime() + 100L);
return generateTestCert(dn, pair, algorithm, from, to);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just do -
generateTestCert(dn, pair, algorithm, from, from);
Means eliminate the to and pass from only instead, rather than this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, have set endDate same as startDate.

Comment on lines 332 to 333
Date to = from;
return generateTestCert(dn, pair, algorithm, from, to);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can directly pass from instead of to in generateTestCert
something like - generateTestCert(dn, pair, algorithm, from, from);
no need to have
Date to = from;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think it may be more readable to keep the fields of "from" and "to"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability better to add a comment explaining why we are passing from for both arguments.
Though trivial assigning unnecessary would have cost and isn't a good practice IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Have added a comment for readability.

@adoroszlai adoroszlai changed the title HDDS-4736. Eliminate test failure caused by testExpiredCertificate HDDS-4736. Intermittent failure in testExpiredCertificate Jan 29, 2021
@symious
Copy link
Contributor Author

symious commented Jan 29, 2021

@adoroszlai @ayushtkn Thanks for the review.

@ayushtkn ayushtkn merged commit e47be43 into apache:master Jan 29, 2021
@ayushtkn
Copy link
Member

Thanx @symious for the contribution and @adoroszlai for the review!!!

errose28 added a commit to errose28/ozone that referenced this pull request Feb 1, 2021
* master: (176 commits)
  HDDS-4760. Intermittent failure in ozone-ha acceptance test (apache#1853)
  HDDS-4770. Upgrade Ratis Thirdparty to 0.6.0 (apache#1868)
  HDDS-4765. Update close-pending workflow for new repo (apache#1856)
  HDDS-4737. Add ModifierOrder to checkstyle rules (apache#1839)
  HDDS-4704. Add permission check in OMDBCheckpointServlet (apache#1801)
  HDDS-4757. Unnecessary WARNING to set OZONE_CONF_DIR (apache#1849)
  HDDS-4751. TestOzoneFileSystem#testTrash failed when enabledFileSystemPaths and omRatisDisabled (apache#1851)
  HDDS-4736. Intermittent failure in testExpiredCertificate (apache#1838)
  HDDS-4758. Adjust classpath of ozone version to include log4j (apache#1850)
  HDDS-4518. Add metrics around Trash Operations. (apache#1832)
  HDDS-4708. Optimization: update RetryCount less frequently (update once per ~100) (apache#1805)
  HDDS-4748. sonarqube issue fix - "static" members should be accessed statically (apache#1748)
  HDDS-2402. Adapt hadolint check to improved CI framework (apache#1778)
  HDDS-4698. Upgrade Java for Sonar check (apache#1800)
  HDDS-4739. Upgrade Ratis to 1.1.0-eb66796d-SNAPSHOT (apache#1842)
  HDDS-4735. Fix typo in hdds.proto (apache#1837)
  HDDS-4430. OM failover timeout is too short (apache#1807)
  HDDS-4477. Delete txnId in SCMMetadataStoreImpl may drop to 0 after SCM restart. (apache#1828)
  HDDS-4688. Update Hadoop version to 3.2.2 (apache#1795)
  HDDS-4725. Change metrics unit from nanosecond to millisecond (apache#1823)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants