From e65c5bdf45c34ab8244d531f7c9c35243bc5e1e1 Mon Sep 17 00:00:00 2001 From: Alka Trivedi Date: Tue, 21 Jan 2025 17:00:33 +0530 Subject: [PATCH] refactor --- .../presubmit/node14/system-test-multiplexed-session.cfg | 2 +- .kokoro/system-test.sh | 6 ------ .kokoro/trampoline_v2.sh | 1 + src/session-factory.ts | 1 + 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.kokoro/presubmit/node14/system-test-multiplexed-session.cfg b/.kokoro/presubmit/node14/system-test-multiplexed-session.cfg index 8bf1160cd..aeeace4e8 100644 --- a/.kokoro/presubmit/node14/system-test-multiplexed-session.cfg +++ b/.kokoro/presubmit/node14/system-test-multiplexed-session.cfg @@ -12,6 +12,6 @@ env_vars: { } env_vars: { - key: "GOOGLE_CLOUD_SPANNER_ENABLE_MULTIPLEXED_SESSIONS" + key: "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS" value: "true" } \ No newline at end of file diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index bb20a4220..a90d5cfec 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -45,12 +45,6 @@ if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]] || [[ $KOKORO_BUILD_ART trap cleanup EXIT HUP fi -# If tests are running with enabled multiplexed session, configure env -# GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS -if [[ $GOOGLE_CLOUD_SPANNER_ENABLE_MULTIPLEXED_SESSIONS = *"true"* ]]; then - export GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS=true -fi - npm run system-test # codecov combines coverage across integration and unit tests. Include diff --git a/.kokoro/trampoline_v2.sh b/.kokoro/trampoline_v2.sh index 5d6cfcca5..23b5f7893 100755 --- a/.kokoro/trampoline_v2.sh +++ b/.kokoro/trampoline_v2.sh @@ -165,6 +165,7 @@ if [[ -n "${KOKORO_BUILD_ID:-}" ]]; then # For flakybot "KOKORO_GITHUB_COMMIT_URL" "KOKORO_GITHUB_PULL_REQUEST_URL" + "GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS" ) elif [[ "${TRAVIS:-}" == "true" ]]; then RUNNING_IN_CI="true" diff --git a/src/session-factory.ts b/src/session-factory.ts index 1559176bc..34f0d7642 100644 --- a/src/session-factory.ts +++ b/src/session-factory.ts @@ -118,6 +118,7 @@ export class SessionFactory ? (this.isMultiplexed = true) : (this.isMultiplexed = false); // Multiplexed sessions should only be created if its enabled. + console.log('mux enabled?: ', this.isMultiplexed); if (this.isMultiplexed) { this.multiplexedSession_.on('error', this.emit.bind(database, 'error')); this.multiplexedSession_.createSession();