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

Set max-workers=1 for tests under CC #29169

Closed

Conversation

abstratt
Copy link
Member

so they run deterministically, and we avoid flakiness.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@abstratt abstratt requested a review from a team as a code owner May 15, 2024 23:23
@abstratt abstratt added this to the 8.9 RC1 milestone May 15, 2024
@abstratt abstratt self-assigned this May 15, 2024
@abstratt abstratt force-pushed the rchaves/master/fix-flakiness-in-tests-under-cc branch from df1254a to cc70a01 Compare May 15, 2024 23:26
so they run deterministically, and we avoid flakiness.
@abstratt abstratt force-pushed the rchaves/master/fix-flakiness-in-tests-under-cc branch from cc70a01 to 51d44ac Compare May 15, 2024 23:27
@@ -27,6 +28,7 @@ class ConfigurationCacheGradleExecuter extends DaemonGradleExecuter {

static final List<String> CONFIGURATION_CACHE_ARGS = [
"--${ConfigurationCacheOption.LONG_OPTION}",
"-D${ParallelismBuildOptions.MaxWorkersOption.GRADLE_PROPERTY}=1",
Copy link
Member

Choose a reason for hiding this comment

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

🤔 I wonder if we lose some coverage here. I understand that a few tests depend on the order of tasks, though most of the tests shouldn't. And if we run those tests with more than one worker then we exercise some parallelism at runtime that we wouldn't do when setting this to only one worker. I am also quite sure that a few tests require more than one worker to work.

Copy link
Member Author

Choose a reason for hiding this comment

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

My opinion on that is that if we want to test parallelism, we should test for that explicitly in tests dedicated for that. Everywhere else, concurrency adds non-determinism that is accidental to functionality being tested, making tests harder to write, or that are flaky.

Re: tests that require more than one worker to work, if they don't yet, they can override that option, right (and some already do)? There have been some failures in the first run, it may be due some instances of that.

Copy link
Member

Choose a reason for hiding this comment

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

I think we want to test that parallelism introduced by CC doesn't break existing features. I don't think we need extra tests for all those cases.

Copy link
Member Author

@abstratt abstratt May 16, 2024

Choose a reason for hiding this comment

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

It is a tradeoff, for sure

Copy link
Member

Choose a reason for hiding this comment

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

I am feeling increasingly strongly that we shouldn't do this. Instead of marking the tests that need parallelism, we should fix the tests that don't work with it. This would be an investment for the future when we enable CC by default.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @wolfs. I feel it's important that new functionality / tests get exposure to the real world scenario of parallelism by default.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see accidental coverage as a secondary benefit, but addressing systemic flakiness that defeats test reliability would trump that.

I will archive this PR then.

Copy link
Member

Choose a reason for hiding this comment

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

I understand your point of view but I wouldn't classify it as accidental coverage as these are E2E tests.

@abstratt abstratt marked this pull request as draft May 16, 2024 13:29
@abstratt
Copy link
Member Author

@bot-gradle test ACC

@gradle gradle deleted a comment from abstratt May 16, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

@abstratt
Copy link
Member Author

@bot-gradle test ACC

@gradle gradle deleted a comment from abstratt May 16, 2024
@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you. Click here to see all build failures.

@abstratt
Copy link
Member Author

Will pursue a different approach.

@abstratt abstratt closed this May 17, 2024
@github-actions github-actions bot removed this from the 8.9 RC1 milestone May 17, 2024
@abstratt
Copy link
Member Author

Will pursue a different approach.

Please see: #29225

CC: @blindpirate

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.

None yet

5 participants