zanmato1984 commented on code in PR #41330:
URL: https://github.com/apache/arrow/pull/41330#discussion_r1587853471


##########
cpp/src/gandiva/cache_test.cc:
##########
@@ -38,5 +42,77 @@ TEST(TestCache, TestGetPut) {
   ASSERT_EQ(cache.GetObjectCode(TestCacheKey(2)), "world");
 }
 
-TEST(TestCache, TestGetCacheCapacity) { ASSERT_EQ(GetCapacity(), 5000); }
+namespace {
+constexpr auto capacity_env_var = "GANDIVA_CACHE_SIZE";
+constexpr auto default_capacity = 5000;
+}  // namespace
+
+TEST(TestCache, TestGetCacheCapacityDefault) {
+  ASSERT_EQ(GetCapacity(), default_capacity);
+}
+
+TEST(TestCache, TestGetCacheCapacityEnvVar) {
+  // Uncleared env var may have side-effect to subsequent tests. Use a 
structure to help
+  // clearing the env var when leaving the scope.
+  struct ScopedEnvVar {

Review Comment:
   Ah, that's great to know. Will do. Thank you!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to