Skip to content

Fix/sdk 7270 session name per test - #148

Merged
rahulpsq merged 2 commits into
sdk_v9_pre_prod_14augfrom
fix/sdk-7270-session-name-per-test
Aug 14, 2026
Merged

Fix/sdk 7270 session name per test#148
rahulpsq merged 2 commits into
sdk_v9_pre_prod_14augfrom
fix/sdk-7270-session-name-per-test

Conversation

@rahulpsq

Copy link
Copy Markdown
Contributor

What is this about?

Related Jira task/s

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

Release notes (internal): (required — engineer-facing; what actually changed / why)

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

anish353 and others added 2 commits August 12, 2026 16:30
… worker teardown (SDK-7270)

Since 9.27 the SDK self-bootstraps the platform binary, so BrowserstackCLI.isRunning()
is true on every run and service.ts skips the legacy per-test rename. Ownership moved to
automateModule, which records the per-test name in sessionMap but issues no PUT until
onAfterExecute -- reached only from service.ts's after() hook, i.e. once at worker teardown.

Every session's name therefore depended on a single event at the very end of the worker.
Suites that reload the session per test have already closed those sessions by then, and a
worker that never reaches after() (interrupted run, hard exit, crash) never fires
onAfterExecute at all -- leaving every session on its creation-time sessionName capability.

Name the session from onBeforeTest, while it is still the live session, via a new
flushSessionName() helper de-duped on SessionData.appliedName. onAfterExecute now calls the
same helper, becoming a final sweep that no-ops for sessions already named. Restores the
pre-9.27 per-test timing with no extra API calls in the steady state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rahulpsq
rahulpsq requested a review from a team as a code owner August 14, 2026 14:59
@rahulpsq
rahulpsq requested review from 07souravkunda and rounak610 and removed request for a team August 14, 2026 14:59
@rahulpsq
rahulpsq merged commit d4878ad into sdk_v9_pre_prod_14aug Aug 14, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants