Skip to content

Add force single data path option for integ tests #71868

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

Conversation

henningandersen
Copy link
Contributor

@henningandersen henningandersen commented Apr 19, 2021

Some functionality will no longer work with multiple data paths and in
order to run integration tests for that, we need the capability to
force a single data path for those tests.

Relates #71844

Opt'ed for a method on ESIntegTestCase over adding to the annotation, since this felt less intrusive and MDP is going away anyway.

Some functionality will no longer work with multiple data paths and in
order to run integration tests for that, we need the capability to
force a single data path for those tests.

Relates elastic#71844
@henningandersen henningandersen added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label v8.0.0 v7.13.0 labels Apr 19, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@henningandersen henningandersen added :Delivery/Build Build or test infrastructure and removed :Core/Infra/Core Core issues without another label labels Apr 19, 2021
@elasticmachine elasticmachine added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Apr 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

@henningandersen henningandersen added the :Core/Infra/Core Core issues without another label label Apr 19, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 19, 2021
@henningandersen henningandersen removed the :Delivery/Build Build or test infrastructure label Apr 19, 2021
@elasticmachine elasticmachine removed the Team:Delivery Meta label for Delivery team label Apr 19, 2021
Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I left a suggestion on how I think we can improve the clarity of the statement question (which, to be clear, was starting from a place of have opportunities for improvement), no need for another round.

@@ -350,7 +352,7 @@ public InternalTestCluster(
numSharedDedicatedMasterNodes, numSharedDataNodes, numSharedCoordOnlyNodes,
autoManageMasterNodes ? "auto-managed" : "manual");
this.nodeConfigurationSource = nodeConfigurationSource;
numDataPaths = random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1;
numDataPaths = forceSingleDataPath == false && random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1;
Copy link
Member

Choose a reason for hiding this comment

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

Could we rewrite this slightly so it’s clearer: I would want it to read “if forceSingleDataPath is true then 1 else some random number of data paths” instead of the double negation right now. How about

// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextInt(5) != 0 ? 1 : 2 + random.nextInt(3);

And maybe that random.nextInt(5) !=0 should be random.nextDouble() < 0.8 and then it’s even clearer?

// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextDouble() < 0.8 ? 1 : 2 + random.nextInt(3);

And for one more iteration on clarity, how about randomIntBetween(2, 4)?

// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextDouble() < 0.8 ? 1 : randomIntBetween(2, 4);

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, fixed in two commits 8c84446 and 1ec131a

@henningandersen
Copy link
Contributor Author

@elasticmachine update branch

@henningandersen henningandersen merged commit 4312bf3 into elastic:master Apr 20, 2021
henningandersen added a commit that referenced this pull request Apr 20, 2021
Some functionality will no longer work with multiple data paths and in
order to run integration tests for that, we need the capability to
force a single data path for those tests.

Relates #71844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants