Skip to content

ATLAS-5245: fix unittest failures in EntitySearchProcessorTest#574

Merged
mneethiraj merged 2 commits intoapache:masterfrom
mneethiraj:ATLAS-5245
Mar 23, 2026
Merged

ATLAS-5245: fix unittest failures in EntitySearchProcessorTest#574
mneethiraj merged 2 commits intoapache:masterfrom
mneethiraj:ATLAS-5245

Conversation

@mneethiraj
Copy link
Contributor

What changes were proposed in this pull request?

updated EntitySearchProcessorTest to use Calendar.getInstance(utcTimeZone), to match the timezone used in SearchProcessor.processDateRange().

How was this patch tested?

verified that unit test failures in EntitySearchProcessorTest are resolved.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_UTC constant for reuse in test date calculations.
  • Set FORMATTED_DATE to UTC using the shared constant.
  • Switched several date-range tests from Calendar.getInstance() to Calendar.getInstance(TIME_ZONE_UTC) for UTC-consistent expected values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@jackhalfalltrades jackhalfalltrades left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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). Since processDateRange() 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.

@mneethiraj mneethiraj merged commit 6d418ed into apache:master Mar 23, 2026
5 checks passed
mneethiraj added a commit that referenced this pull request Mar 23, 2026
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