You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "JinwooHwang-SAS (via GitHub)" <gi...@apache.org> on 2025/07/13 17:14:47 UTC

[PR] WellKnownClassSizerJUnitTest [geode]

JinwooHwang-SAS opened a new pull request, #7907:
URL: https://github.com/apache/geode/pull/7907

   <!-- Thank you for submitting a contribution to Apache Geode. -->
   
   <!-- In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken: 
   -->
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [x] Does `gradlew build` run cleanly?
   
   - [x] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   <!-- Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WellKnownClassSizerJUnitTest [geode]

Posted by "JinwooHwang-SAS (via GitHub)" <gi...@apache.org>.
JinwooHwang-SAS commented on PR #7907:
URL: https://github.com/apache/geode/pull/7907#issuecomment-3227875588

   Thanks for your review, @raboof . I am glad to hear there's no risk of regression since the changes are limited to the test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WellKnownClassSizerJUnitTest [geode]

Posted by "JinwooHwang-SAS (via GitHub)" <gi...@apache.org>.
JinwooHwang-SAS commented on code in PR #7907:
URL: https://github.com/apache/geode/pull/7907#discussion_r2303536444


##########
geode-core/src/test/java/org/apache/geode/internal/size/WellKnownClassSizerJUnitTest.java:
##########
@@ -52,7 +53,11 @@ public void testStrings() {
         - ObjectSizer.SIZE_CLASS_ONCE.sizeof(new char[0]);
 
     assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 3 * 2), WellKnownClassSizer.sizeof(test1));
-    assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2), WellKnownClassSizer.sizeof(test2));
+    if (SystemUtils.isAzulJVM()) {
+      assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2 + 8), WellKnownClassSizer.sizeof(test2));
+    } else {
+      assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2), WellKnownClassSizer.sizeof(test2));
+    }

Review Comment:
   Thank you for your thoughtful insight and guidance, @raboof. I do not have a clear technical justification for why Azul requires the additional + 8. I did attempt to investigate the discrepancy, but was unable to determine the underlying cause. I am happy to revise the code to follow your recommendation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WellKnownClassSizerJUnitTest [geode]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof commented on code in PR #7907:
URL: https://github.com/apache/geode/pull/7907#discussion_r2303489149


##########
geode-core/src/test/java/org/apache/geode/internal/size/WellKnownClassSizerJUnitTest.java:
##########
@@ -52,7 +53,11 @@ public void testStrings() {
         - ObjectSizer.SIZE_CLASS_ONCE.sizeof(new char[0]);
 
     assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 3 * 2), WellKnownClassSizer.sizeof(test1));
-    assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2), WellKnownClassSizer.sizeof(test2));
+    if (SystemUtils.isAzulJVM()) {
+      assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2 + 8), WellKnownClassSizer.sizeof(test2));
+    } else {
+      assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2), WellKnownClassSizer.sizeof(test2));
+    }

Review Comment:
   Do you have a motivation why azul needs the extra `+ 8`, or is that just 'trial and error'?
   
   If it's just 'trial and error', I think I'd prefer:
   
   ```suggestion
       if (!SystemUtils.isAzulJVM()) {
           assertEquals(emptySize + roundup(OBJECT_SIZE + 4 + 9 * 2), WellKnownClassSizer.sizeof(test2));
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] WellKnownClassSizerJUnitTest [geode]

Posted by "raboof (via GitHub)" <gi...@apache.org>.
raboof merged PR #7907:
URL: https://github.com/apache/geode/pull/7907


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org