Skip to content
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

SOLR-17156: introducing RandomNoReverseMergePolicyFactory #2289

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

mkhludnev
Copy link
Member

@mkhludnev
Copy link
Member Author

It needs to be spread across other block join tests as well.

Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

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

Cool!

Defend other block join tests from reverse merge.
@mkhludnev
Copy link
Member Author

The scope has blown up. Are there other tests rely on block alignment?

@mkhludnev mkhludnev requested a review from janhoy February 21, 2024 08:06
Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

No; please use SystemPropertiesRestoreRule instead. See its constructor that takes the key and value. No need to add BeforeClass/AfterClass logic to all these tests.
Hopefully no need to bother with touching test infrastructure (e.g. SolrTestCase).

@mkhludnev
Copy link
Member Author

@dsmiley thanks for the guidance. I'll check it out.

@mkhludnev
Copy link
Member Author

SystemPropertiesRestoreRule instead. See its constructor that takes the key and value.

I'm ok with this proposal @dsmiley. But I can't find any usage of two args constructor, so far all tests use systemSetPropertySolrTestsMergePolicyFactory. As far as I understand SystemPropertiesRestoreRule rule already applied and restores props thus, I don't need to bother about restoring in @AfterClass - ok.
Then if I use this rule, I need to copy-paste prop name from systemSetPropertySolrTestsMergePolicyFactory that doesn't seem good for me. if this bi-arg constructor works, should I use RuleChain or just @Rule?

Note: I changed SolrTestCase just to fix its' subclasses which don't inherit SolrTestCase4J.

@dsmiley
Copy link
Contributor

dsmiley commented Feb 26, 2024

if this bi-arg constructor works, should I use RuleChain or just @rule

RuleChain is for more compactly listing many rules and/or if the ordering is important and should be clear. Here, I think simply @ClassRule for an entire test source file (aka test suite).

Then if I use this rule, I need to copy-paste prop name from systemSetPropertySolrTestsMergePolicyFactory that doesn't seem good for me.

Could define the Map.of(...,...) constant in SolrTestCase. This rule accepts a Map constructor. I personally don't care; string literals don't bother me. Some people seem religious about avoiding them. 🤷

@mkhludnev mkhludnev requested a review from dsmiley February 26, 2024 21:07
Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Nice

@mkhludnev mkhludnev merged commit bdd6ea6 into apache:main Feb 27, 2024
3 checks passed
@mkhludnev mkhludnev deleted the SOLR-17156-bjq-reverse-merge-fail branch February 27, 2024 08:37
@mkhludnev
Copy link
Member Author

I think it's test only change, thus it doesn't deserves CHANGES entry

mkhludnev added a commit to mkhludnev/solr that referenced this pull request Feb 27, 2024
 - Defend other block join tests from reverse merge.

 - introduce @ClassRule for no revers merge policy
mkhludnev added a commit that referenced this pull request Feb 27, 2024
)

- Defend other block join tests from reverse merge.

 - introduce @ClassRule for no revers merge policy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants