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

[#1675][FOLLOWUP] fix(test): Fix various flaky tests #1730

Merged
merged 2 commits into from
May 23, 2024

Conversation

rickyma
Copy link
Contributor

@rickyma rickyma commented May 21, 2024

What changes were proposed in this pull request?

Fix various flaky tests:

  1. After using SimpleClusterManager, release resources at once, which might cause tests to fail sometimes.
  2. The compiler machine may not necessarily have a valid broadcast address (maybe in a pod created by K8S, and the broadcast address could be 0.0.0.0). Unit tests should running successfully on such machines. We need to support this scenario.
  3. Refactor the URI.create logic in SimpleClusterManagerTest to support cross-platform operation, such as running tests on Windows.
  4. Use IntegrationTestBase#shutdownServers to reduce duplicated codes.

Why are the changes needed?

For #1675.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Unnecessary.

Copy link

github-actions bot commented May 21, 2024

Test Results

 2 405 files  ±0   2 405 suites  ±0   4h 57m 46s ⏱️ -41s
   931 tests ±0     930 ✅ ±0   1 💤 ±0  0 ❌ ±0 
10 791 runs  ±0  10 777 ✅ ±0  14 💤 ±0  0 ❌ ±0 

Results for commit c63871b. ± Comparison against base commit d9b1d9f.

♻️ This comment has been updated with latest results.

@@ -921,6 +921,7 @@
<java.io.tmpdir>${project.build.directory}/tmp</java.io.tmpdir>
<project.version>${project.version}</project.version>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
<test.mode>true</test.mode>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can see the 2nd point listed above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since RssUtils#getHostIp is a method in a utility class and does not accept any input parameters, we can only use environment variables to inform the internal logic that the unit test is being executed. This approach requires the least amount of changes and is the most reasonable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Em... it seems not enough reasonable. If we should support the similar scenary, we should limit to use it in the test mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running unit tests, they are executed on a single machine and do not interact with other machines. Therefore, unit tests should not require a valid broadcast IP address. Currently, we do not support scenarios where the broadcast IP address of the host machine is 0.0.0.0. I think this is an unreasonable limitation.

Copy link
Contributor

@jerqi jerqi May 22, 2024

Choose a reason for hiding this comment

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

I got it. You should add the comment, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

@rickyma rickyma requested a review from jerqi May 22, 2024 03:00
@rickyma
Copy link
Contributor Author

rickyma commented May 22, 2024

Maybe this should be committed to 0.9 as well.

Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM.

@rickyma
Copy link
Contributor Author

rickyma commented May 22, 2024

We can merge this.

@jerqi jerqi merged commit fddace2 into apache:master May 23, 2024
41 checks passed
@jerqi
Copy link
Contributor

jerqi commented May 23, 2024

Merged to master & branch 0.9.

jerqi pushed a commit that referenced this pull request May 23, 2024
### What changes were proposed in this pull request?

Fix various flaky tests:
1. After using `SimpleClusterManager`, release resources at once, which might cause tests to fail sometimes.
2. The compiler machine may not necessarily have a valid broadcast address (maybe in a pod created by K8S, and the broadcast address could be 0.0.0.0). Unit tests should running successfully on such machines. We need to support this scenario.
3. Refactor the `URI.create` logic in `SimpleClusterManagerTest` to support cross-platform operation, such as running tests on Windows.
4. Use `IntegrationTestBase#shutdownServers` to reduce duplicated codes.


### Why are the changes needed?

For #1675.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Unnecessary.
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.

2 participants