ATLAS-5245: fix unittest failures in EntitySearchProcessorTest#574
Merged
mneethiraj merged 2 commits intoapache:masterfrom Mar 23, 2026
Merged
ATLAS-5245: fix unittest failures in EntitySearchProcessorTest#574mneethiraj merged 2 commits intoapache:masterfrom
mneethiraj merged 2 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates EntitySearchProcessorTest to align date-range expectations with the UTC-based behavior in SearchProcessor.processDateRange(), addressing timezone-dependent unit test failures.
Changes:
- Introduced a shared
TIME_ZONE_UTCconstant for reuse in test date calculations. - Set
FORMATTED_DATEto UTC using the shared constant. - Switched several date-range tests from
Calendar.getInstance()toCalendar.getInstance(TIME_ZONE_UTC)for UTC-consistent expected values.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java:460
testYesterday()only asserts the first value from the returned time-range (start). SinceprocessDateRange()returns a start and end timestamp, this test should also assert the end value to catch off-by-one/end-of-day regressions.
String[] dates = ret.getAttributeValue().split(",");
String attrValue1 = dates[0];
assertEquals(FORMATTED_DATE.format(new Date((Long.parseLong(attrValue1)))), FORMATTED_DATE.format(yesterdayDate.getTime()));
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
repository/src/test/java/org/apache/atlas/discovery/EntitySearchProcessorTest.java
Show resolved
Hide resolved
mneethiraj
added a commit
that referenced
this pull request
Mar 23, 2026
(cherry picked from commit 6d418ed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
updated EntitySearchProcessorTest to use
Calendar.getInstance(utcTimeZone), to match the timezone used inSearchProcessor.processDateRange().How was this patch tested?
verified that unit test failures in EntitySearchProcessorTest are resolved.