Skip to content

Commit

Permalink
fix format and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
majetideepak committed Dec 7, 2024
1 parent 41690d4 commit ce3cc4f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
9 changes: 3 additions & 6 deletions velox/common/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if (${VELOX_BUILD_TESTING})
if(${VELOX_BUILD_TESTING})
add_subdirectory(tests)
endif ()
endif()

velox_add_library(velox_global_config OBJECT GlobalConfig.cpp)

velox_add_library(velox_common_config Config.cpp)
velox_link_libraries(
velox_common_config
PUBLIC velox_common_base
velox_global_config
velox_exception
PUBLIC velox_common_base velox_global_config velox_exception
PRIVATE re2::re2)

1 change: 1 addition & 0 deletions velox/dwio/common/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ target_link_libraries(
velox_dwio_common_test
velox_dwio_common_test_utils
velox_temp_path
velox_global_config
velox_vector_test_lib
Boost::regex
velox_link_libs
Expand Down
12 changes: 7 additions & 5 deletions velox/dwio/common/tests/LoggedExceptionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
#include <folly/Random.h>
#include <gtest/gtest.h>
#include "velox/common/config/GlobalConfig.h"
#include "velox/dwio/common/exception/Exception.h"

using namespace facebook::velox::dwio::common::exception;
Expand All @@ -24,13 +25,14 @@ namespace {
void testTraceCollectionSwitchControl(bool enabled) {
// Logged exception is system type of velox exception.
// Disable rate control in the test.
FLAGS_velox_exception_user_stacktrace_rate_limit_ms = 0;
FLAGS_velox_exception_system_stacktrace_rate_limit_ms = 0;
config::globalConfig.exceptionUserStacktraceRateLimitMs = 0;
config::globalConfig.exceptionSystemStacktraceRateLimitMs = 0;

// NOTE: the user flag should not affect the tracing behavior of system type
// NOTE: the user config should not affect the tracing behavior of system type
// of exception collection.
FLAGS_velox_exception_user_stacktrace_enabled = folly::Random::oneIn(2);
FLAGS_velox_exception_system_stacktrace_enabled = enabled ? true : false;
config::globalConfig.exceptionUserStacktraceEnabled = folly::Random::oneIn(2);
config::globalConfig.exceptionSystemStacktraceEnabled = enabled ? true : false;

try {
throw LoggedException("Test error message");
} catch (VeloxException& e) {
Expand Down
3 changes: 2 additions & 1 deletion velox/flag_definitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
velox_add_library(velox_flag_definitions OBJECT flags.cpp)
velox_link_libraries(velox_flag_definitions PRIVATE velox_global_config gflags::gflags)
velox_link_libraries(velox_flag_definitions PRIVATE velox_global_config
gflags::gflags)

0 comments on commit ce3cc4f

Please sign in to comment.