Skip to content

[fix][test] Fix flaky test NarUnpackerTest#21328

Merged
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-flaky-NarUnpackerTest
Oct 9, 2023
Merged

[fix][test] Fix flaky test NarUnpackerTest#21328
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-flaky-NarUnpackerTest

Conversation

@lhotari

@lhotari lhotari commented Oct 9, 2023

Copy link
Copy Markdown
Member

Fixes #21291
Fixes #21285

Motivation

NarUnpackerTest is really flaky. See the above isues that this PR fixes.
When investigating the problem, I was able to reproduce the issue by running the test within Docker with constrained resources. There's a 30 second timeout in the shouldExtractFilesOnceInDifferentProcess test for the 10 different processes to complete. This takes much longer since each process uses significant amount of CPU. The fix is to reduce the CPU consumption by reducing the test data size, reducing the number of processes and tuning the JVM parameters for the forked processes.

Modifications

  • reduce number of processes from 10 to 5
  • reduce the number of files in the sample zip from 10000 to 5000
  • make the test use less CPU resources so that it will run in CI with constrained resources
    • make JIT compiler stop at C1
    • disable JMX registration in Log4j2 which showed up in profiling
    • increase max heap size from 64MB to 96MB to give more head room for GC

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

- reduce number of processes from 10 to 5
- reduce the number of files in the sample zip from 10000 to 5000
- make the test use less CPU resources so that it will run in CI with constrained resources
  - make JIT compiler stop at C1
  - disable JMX registration in Log4j2 which showed up in profiling
  - increase max heap size from 64MB to 96MB to give more head room for GC
@lhotari lhotari added this to the 3.2.0 milestone Oct 9, 2023
@lhotari lhotari requested a review from nodece October 9, 2023 09:01
@lhotari lhotari self-assigned this Oct 9, 2023
@lhotari lhotari requested a review from Technoboy- October 9, 2023 09:02
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Oct 9, 2023
@poorbarcode

Copy link
Copy Markdown
Contributor

Since branch-3.0 is a long-term support release, I think it also needs this fix. So I added the label release:3.0.x

@lhotari lhotari merged commit e76a86e into apache:master Oct 9, 2023
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
@lhotari lhotari added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Oct 9, 2023
lhotari added a commit that referenced this pull request Oct 9, 2023
(cherry picked from commit e76a86e)

# Conflicts:
#	pulsar-common/src/test/java/org/apache/pulsar/common/nar/NarUnpackerTest.java
@lhotari lhotari added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Oct 9, 2023
vinayakmalik95 pushed a commit to tmdc-io/pulsar that referenced this pull request Oct 12, 2023
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 6, 2023
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Dec 8, 2023
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.

Flaky-test: NarUnpackerTest.shouldExtractFilesOnceInDifferentProcess Flaky-test: NarUnpackerTest.deleteSampleZipFile

2 participants