Skip to content

TEZ-4667: Correct the test case testInMemAllocationWithJvmMaxMemory - #445

Merged
abstractdog merged 1 commit into
apache:masterfrom
maheshrajus:TEZ-4667
Jan 9, 2026
Merged

TEZ-4667: Correct the test case testInMemAllocationWithJvmMaxMemory#445
abstractdog merged 1 commit into
apache:masterfrom
maheshrajus:TEZ-4667

Conversation

@maheshrajus

@maheshrajusmaheshrajus commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

This test case is failing in some env when requested memory is less compared to available memory.
We need to increase the requested memory so that it will not fail.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec26m 57sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall11m 56smaster passed
+1 💚compile0m 37smaster passed
+1 💚checkstyle1m 4smaster passed
+1 💚javadoc0m 45smaster passed
+0 🆗spotbugs2m 0stez-runtime-library in master has 241 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall0m 25sthe patch passed
+1 💚codespell0m 28sNo new issues.
+1 💚compile0m 23sthe patch passed
+1 💚javac0m 23sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 12sthe patch passed
+1 💚javadoc0m 21sthe patch passed
+1 💚spotbugs1m 13sthe patch passed
_ Other Tests _
+1 💚unit6m 0stez-runtime-library in the patch passed.
+1 💚asflicense0m 13sThe patch does not generate ASF License warnings.
54m 0s
SubsystemReport/Notes
DockerClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/1/artifact/out/Dockerfile
GITHUB PR#445
Optional Testsdupname asflicense javac javadoc unit spotbugs checkstyle codespell detsecrets compile
unameLinux 5a509883dafb 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-home/workspace/tez-multibranch_PR-445/src/.yetus/personality.sh
git revisionmaster / 4aa5728
Default JavaUbuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/1/testReport/
Max. process+thread count1125 (vs. ulimit of 5500)
modulesC: tez-runtime-library U: tez-runtime-library
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/1/console
versionsgit=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered byApache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@abstractdog

Copy link
Copy Markdown
Contributor

@maheshrajus: thanks for taking care of this, a few questions:

  1. what's the issue that's thrown in the problematic case?
  2. what was the requested/available memory in that case?
  3. is it 100% sure that * 10 solves the problem in this case when + 100L failed?

@maheshrajus

Copy link
Copy Markdown
ContributorAuthor

@abstractdog
The RequestSize size is coming less in test case failure scenario when compare to InMemThreshold value.

INFO [Time-limited test] impl.TestSimpleFetchedInputAllocator (TestSimpleFetchedInputAllocator.java:testInMemAllocationWithJvmMaxMemory(99)) - jvmMax: 1073741824
INFO [Time-limited test] impl.TestSimpleFetchedInputAllocator (TestSimpleFetchedInputAllocator.java:testInMemAllocationWithJvmMaxMemory(107)) - InMemThreshold: 107374184
INFO [Time-limited test] impl.SimpleFetchedInputAllocator (SimpleFetchedInputAllocator.java:(117)) - srcName: RequestedMemory=107374184, AssignedMemory=107374184, maxSingleShuffleLimit=107374184
INFO [Time-limited test] impl.TestSimpleFetchedInputAlloc¸ator (TestSimpleFetchedInputAllocator.java:testInMemAllocationWithJvmMaxMemory(115)) - RequestSize: 42949776

here RequestSize should be greater than InMemThreshold. Then only it will allocate from the DISK. So it is failing in some env only. In any case we should put more RequestSize . So currently * 10 is solving the issue.

Test sample:

 // check if requestSize is greater than maxSingleShuffleLimit
assertTrue(requestSize > inputManager.maxSingleShuffleLimit);
// requestSize is greater than the maxSingleShuffleLimit, so allocation is from DISK
FetchedInput fi1 = inputManager.allocate(requestSize, compressedSize, new InputAttemptIdentifier(1, 1));
assertEquals(FetchedInput.Type.DISK, fi1.getType());

@abstractdog

Copy link
Copy Markdown
Contributor

I still feel the test case is shady in its current form, and I'm afraid this fix won't make it any clearer
having this magic:

 long requestSize = (long) (0.4f * inMemThreshold) + 100L;

requestSize should be greater than inMemThreshold, which is a lower bound, also I guess it has an upper bound constraint (jvm memory, or whatever), am I right to assume that?

could this line be clearer to comply with those constraints and work in every scenario (regardless of the jvmMax)

@maheshrajus

maheshrajus commented Dec 5, 2025

Copy link
Copy Markdown
ContributorAuthor

@abstractdog I will make requestSize simple instead of jvm memory and "(long) (0.4f * inMemThreshold) + 100L" checks. Lower bound value already tested in existed test cases. i will put requestSize size more than inMemThreshold and test the scenario

Planning to modify like this:
long jvmMax = 1073741824L;
LOG.info("jvmMax: " + jvmMax);

float bufferPercent = 0.1f;
conf.setFloat(TezRuntimeConfiguration.TEZ_RUNTIME_SHUFFLE_FETCH_BUFFER_PERCENT, bufferPercent);
conf.setFloat(TezRuntimeConfiguration.TEZ_RUNTIME_SHUFFLE_MEMORY_LIMIT_PERCENT, 1.0f);
conf.setStrings(TezRuntimeFrameworkConfigs.LOCAL_DIRS, localDirs.getAbsolutePath());
long inMemThreshold = (long) (bufferPercent * jvmMax);
LOG.info("InMemThreshold: " + inMemThreshold);
SimpleFetchedInputAllocator inputManager = new SimpleFetchedInputAllocator(
"srcName", UUID.randomUUID().toString(), 123, conf,
jvmMax, inMemThreshold);
**long requestSize = inMemThreshold + 100L;**
requestSize size should be more than inMemThreshold so that it will be allocated from DISK.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 52sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall12m 7smaster passed
+1 💚compile0m 39smaster passed
+1 💚checkstyle1m 4smaster passed
+1 💚javadoc0m 45smaster passed
+0 🆗spotbugs2m 0stez-runtime-library in master has 241 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall0m 25sthe patch passed
+1 💚codespell0m 28sNo new issues.
+1 💚compile0m 25sthe patch passed
+1 💚javac0m 25sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 12sthe patch passed
+1 💚javadoc0m 20sthe patch passed
+1 💚spotbugs1m 10sthe patch passed
_ Other Tests _
+1 💚unit6m 0stez-runtime-library in the patch passed.
+1 💚asflicense0m 13sThe patch does not generate ASF License warnings.
28m 6s
SubsystemReport/Notes
DockerClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/2/artifact/out/Dockerfile
GITHUB PR#445
Optional Testsdupname asflicense javac javadoc unit spotbugs checkstyle codespell detsecrets compile
unameLinux 91e2ecc61eca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-home/workspace/tez-multibranch_PR-445/src/.yetus/personality.sh
git revisionmaster / 263c049
Default JavaUbuntu-21.0.9+10-Ubuntu-124.04
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/2/testReport/
Max. process+thread count1109 (vs. ulimit of 5500)
modulesC: tez-runtime-library U: tez-runtime-library
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-445/2/console
versionsgit=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered byApache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@maheshrajus

Copy link
Copy Markdown
ContributorAuthor

@abstractdog Can you review and approve the changes ? thanks !

@abstractdog
abstractdog self-requested a review January 7, 2026 10:46
@abstractdog
abstractdog merged commit dd010a2 into apache:masterJan 9, 2026
4 checks passed
Sign up for freeto 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.

3 participants

@maheshrajus@tez-yetus@abstractdog