diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-07-08 11:08:16 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-07-08 11:08:16 -0400 |
commit | 1ec6c744048a2905b0f2bf83f035a8fb8798dbdf (patch) | |
tree | 010121ef262e206a84efde7fcc03d9059e071e5d | |
parent | f37d2c307617302f2ed5dfead7e280da54a7d3e4 (diff) |
SL-18837: Set APR_LOG once for the whole job
instead of a new value for each LLProcess::create() invocation.
Since the internal apr_log() function only looks at APR_LOG once per process,
the first test (which succeeded, hence no log file dump) left the log file
open with that same original pathname. Resetting the APR_LOG environment
variable for subsequent runs only made the new code in llprocess_test look for
files that were never created.
-rw-r--r-- | .github/workflows/build.yaml | 1 | ||||
-rw-r--r-- | indra/llcommon/tests/llprocess_test.cpp | 32 |
2 files changed, 17 insertions, 16 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dc8f9f15cd..f585fa1c39 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,7 @@ jobs: - runner: macos-12-xl runs-on: ${{ matrix.runner }} env: + APR_LOG: "$RUNNER_TEMP/apr.log" AUTOBUILD_ADDRSIZE: ${{ matrix.addrsize }} AUTOBUILD_BUILD_ID: ${{ github.run_id }} # authorizes fetching private constituent packages diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index 6fcc6fd8aa..a01ec84547 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -151,10 +151,6 @@ struct PythonProcessLauncher /// Launch Python script; verify that it launched void launch() { - std::string logpath{ NamedTempFile::temp_path("apr", ".log").string() }; -#if LL_WINDOWS - _putenv_s("APR_LOG", logpath.c_str()); -#endif try { mPy = LLProcess::create(mParams); @@ -162,21 +158,25 @@ struct PythonProcessLauncher } catch (const tut::failure&) { - std::ifstream inf(logpath.c_str()); - if (! inf.is_open()) - { - LL_WARNS() << "Couldn't open '" << logpath << "'" << LL_ENDL; - } - else + const char* APR_LOG = getenv("APR_LOG"); + if (APR_LOG && *APR_LOG) { - LL_WARNS() << "==============================" << LL_ENDL; - LL_WARNS() << "From '" << logpath << "':" << LL_ENDL; - std::string line; - while (std::getline(inf, line)) + std::ifstream inf(APR_LOG); + if (! inf.is_open()) { - LL_WARNS() << line << LL_ENDL; + LL_WARNS() << "Couldn't open '" << APR_LOG << "'" << LL_ENDL; + } + else + { + LL_WARNS() << "==============================" << LL_ENDL; + LL_WARNS() << "From '" << APR_LOG << "':" << LL_ENDL; + std::string line; + while (std::getline(inf, line)) + { + LL_WARNS() << line << LL_ENDL; + } + LL_WARNS() << "==============================" << LL_ENDL; } - LL_WARNS() << "==============================" << LL_ENDL; } throw; } |