Skip to content

Comments

Fix MSQ IT test#13808

Merged
paul-rogers merged 4 commits intoapache:masterfrom
adarshsanjeev:msq-it-fix
Feb 22, 2023
Merged

Fix MSQ IT test#13808
paul-rogers merged 4 commits intoapache:masterfrom
adarshsanjeev:msq-it-fix

Conversation

@adarshsanjeev
Copy link
Contributor

Due to LATEST when used in combination with an EXTERN source, all values of __time are seen as 0. This leads to some potentially undeterminsitic values being returned from queries.
This fixes flaky failures for the MSQ IT tests and unblocks the CICD.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

EARLIEST("user", 128) AS "first_user",
LATEST("user", 128) AS "last_user"
EARLIEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "first_user",
LATEST_BY("user", CASE WHEN CAST("timestamp" AS BIGINT) > 0 THEN MILLIS_TO_TIMESTAMP(CAST("timestamp" AS BIGINT)) ELSE TIME_PARSE("timestamp") END, 128) AS "last_user"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a "fix", it is a workaround that allows the test to pass through the underlying code is broken. A better approach is to simply disable the test with a comment.

That is, this "fix" substitutes another test case (which works) for the test case which fails because it is revealing a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, this isn't a fix, it's a workaround, but the tests that are failing are not to check for aggregations. This is used for a few tests like BatchIngest test and ReindexTest, and any aggregation would work for these tests. Disabling them might make a part of the code untested instead. Should I disable these tests for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about this. This test did, in fact, find a bug, so it is useful. But, the point of the test is actually to exercise something else.

So, maybe comment out the lines that fail. Ensure we have an Apache issue for the problem. Have that problem point to the test and say that, to see the bug, just uncomment the lines.

Then, go ahead and add your new lines so that the test passes.

This will achieve the short-term goal (clean test) while also ensuring we don't forget to fix the underlying issue.

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 a lot for the suggestion! That sounds like a good way to handle this. I have made the changes.

Copy link
Contributor

@paul-rogers paul-rogers left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM.

@paul-rogers paul-rogers merged commit aceeac9 into apache:master Feb 22, 2023
@clintropolis clintropolis added this to the 26.0 milestone Apr 10, 2023
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