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

Make TestNodeMemoryConfig success independent of running heap size #23080

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

ghelmling
Copy link
Contributor

Description

There is a mismatch between the default values in com.facebook.presto.memory.NodeMemoryConfig, which are a factor of the runtime heap size, and the test override values in com.facebook.presto.memory.TestNodeMemoryConfig, which are hard-coded. This can cause the tests to fail when: (heap size) * (default factor) == (test override).

Motivation and Context

When run with a 5GB heap, tests will fail due to the hard-coded values:

mvn test -Dtest=com.facebook.presto.memory.TestNodeMemoryConfig -Dsurefire.failIfNoSpecifiedTests=false -pl presto-main -am -Dair.test.jvmsize=5g

[ERROR] Tests run: 4, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 1.305 s <<< FAILURE! - in com.facebook.presto.memory.TestNodeMemoryConfig
[ERROR] com.facebook.presto.memory.TestNodeMemoryConfig.testOutOfRangeBroadcastMemoryLimit  Time elapsed: 0.381 s  <<< FAILURE!
java.lang.AssertionError: SoftMaxQueryMemoryPerNode did not expect [536870912B] but found [512MB]
	at org.testng.Assert.fail(Assert.java:110)
	at org.testng.Assert.failEquals(Assert.java:1417)
	at org.testng.Assert.assertNotEqualsImpl(Assert.java:156)
	at org.testng.Assert.assertNotEquals(Assert.java:1986)
	at com.facebook.airlift.configuration.testing.ConfigAssertions.assertAttributesNotEqual(ConfigAssertions.java:228)
	at com.facebook.airlift.configuration.testing.ConfigAssertions.assertFullMapping(ConfigAssertions.java:131)
	at com.facebook.presto.memory.TestNodeMemoryConfig.testOutOfRangeBroadcastMemoryLimit(TestNodeMemoryConfig.java:97)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
	at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220)
	at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
	at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193)
	at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

[ERROR] com.facebook.presto.memory.TestNodeMemoryConfig.testExplicitPropertyMappings  Time elapsed: 0.382 s  <<< FAILURE!
java.lang.AssertionError: SoftMaxQueryMemoryPerNode did not expect [536870912B] but found [512MB]
	at org.testng.Assert.fail(Assert.java:110)
	at org.testng.Assert.failEquals(Assert.java:1417)
	at org.testng.Assert.assertNotEqualsImpl(Assert.java:156)
	at org.testng.Assert.assertNotEquals(Assert.java:1986)
	at com.facebook.airlift.configuration.testing.ConfigAssertions.assertAttributesNotEqual(ConfigAssertions.java:228)
	at com.facebook.airlift.configuration.testing.ConfigAssertions.assertFullMapping(ConfigAssertions.java:131)
	at com.facebook.presto.memory.TestNodeMemoryConfig.testExplicitPropertyMappings(TestNodeMemoryConfig.java:70)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:135)
	at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:673)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:220)
	at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
	at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:945)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:193)
	at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Impact

Test Plan

mvn test -Dtest=com.facebook.presto.memory.TestNodeMemoryConfig -Dsurefire.failIfNoSpecifiedTests=false -pl presto-main -am -Dair.test.jvmsize=5g

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@ghelmling ghelmling requested a review from a team as a code owner June 25, 2024 23:33
Copy link

linux-foundation-easycla bot commented Jun 25, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@tdcmeehan tdcmeehan self-assigned this Jun 25, 2024
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

Nice discovery!

@amitkdutta amitkdutta merged commit c70fd3c into prestodb:master Jun 26, 2024
55 of 56 checks passed
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