MCPcopy Create free account
hub / github.com/apache/impala / SetUpTestCase

Method SetUpTestCase

be/src/exprs/expr-test.cc:203–250  ·  view source on GitHub ↗

Run once (independent of parameter values).

Source from the content-addressed store, hash-verified

201 public:
202 // Run once (independent of parameter values).
203 static void SetUpTestCase() {
204 InitFeSupport(false);
205 ABORT_IF_ERROR(impala::LlvmCodeGen::InitializeLlvm());
206
207 // The host running this test might have an out-of-date tzdata package installed.
208 // To avoid tzdata related issues, we will load time-zone db from the testdata
209 // directory.
210 FLAGS_hdfs_zone_info_zip = Substitute("file://$0/testdata/tzdb/2017c.zip",
211 getenv("IMPALA_HOME"));
212 ABORT_IF_ERROR(TimezoneDatabase::Initialize());
213
214 // Disable llvm optimization passes if the env var is no set to true. Running without
215 // the optimizations makes the tests run much faster.
216 char* optimizations = getenv("EXPR_TEST_ENABLE_OPTIMIZATIONS");
217 if (optimizations != NULL && strcmp(optimizations, "true") == 0) {
218 cout << "Running with optimization passes." << endl;
219 FLAGS_disable_optimization_passes = false;
220 } else {
221 cout << "Running without optimization passes." << endl;
222 FLAGS_disable_optimization_passes = true;
223 }
224
225 // Since the statestore is leaked and threads can be running at exit, it is
226 // unsafe to destroy the statestore_metrics before exit. Running threads can
227 // try to access metrics and run into TSAN issues or access memory that has
228 // been freed.
229 statestore_metrics = new MetricGroup("statestore_metrics");
230 IGNORE_LEAKING_OBJECT(statestore_metrics);
231
232 // Create an in-process Impala server and in-process backends for test environment
233 // without any startup validation check
234 FLAGS_abort_on_config_error = false;
235 VLOG_CONNECTION << "creating test env";
236 VLOG_CONNECTION << "starting backends";
237 statestore = new Statestore(statestore_metrics);
238 IGNORE_LEAKING_OBJECT(statestore);
239
240 // Pass in 0 to have the statestore use an ephemeral port for the service.
241 ABORT_IF_ERROR(statestore->Init(0));
242 InProcessImpalaServer* impala_server;
243 ABORT_IF_ERROR(InProcessImpalaServer::StartWithEphemeralPorts(
244 FLAGS_hostname, statestore->port(), &impala_server));
245 IGNORE_LEAKING_OBJECT(impala_server);
246
247 executor_.reset(
248 new ImpaladQueryExecutor(FLAGS_hostname, impala_server->GetBeeswaxPort()));
249 ABORT_IF_ERROR(executor_->Setup());
250 }
251
252 static void TearDownTestCase() {
253 // Teardown before global destructors to avoid a race where JvmMetricCache is

Callers

nothing calls this directly

Calls 7

InitFeSupportFunction · 0.85
SubstituteFunction · 0.85
SetupMethod · 0.80
resetMethod · 0.65
InitMethod · 0.45
portMethod · 0.45
GetBeeswaxPortMethod · 0.45

Tested by

no test coverage detected