Skip to content

Conversation

@etinquis
Copy link

@etinquis etinquis commented Oct 11, 2025

This PR adds a new lockTimeout connection setting, which sets LOCK_TIMEOUT (https://learn.microsoft.com/en-us/sql/t-sql/statements/set-lock-timeout-transact-sql) along with the existing connection preamble statements.

Before submitting a PR :

  1. Ensure your fork is created from master branch of the repository.
  2. Run npm install in the root folder.
  3. After bug fix/code change, ensure all the existing tests and new tests (if any) pass (npm run-script test-all). During development, to run individual test use node_modules/nodeunit test/<test_file.js> -t <test_name>.
  # 1 (unrelated?) test failure; I'm running against an ephemeral docker db, if it's relevant: docker run --rm -it -e ACCEPT_EULA=Y -e MSSQL_PID=Express -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 127.0.0.1:17000:1433/tcp mcr.microsoft.com/mssql/server:2022-CU19-ubuntu-22.04
  824 passing (35s)
  11 pending
  1 failing

  1) MessageIO
       #startTls
         handles errors that happen during TLS negotiation:

      AssertionError: expected 'ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILU…' to equal 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE'
      + expected - actual

      -ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE
      +ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE
      
      at /home/etinquis/Projects/tedious/test/unit/message-io-test.ts:566:20
      at processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async Promise.all (index 0)
      at Context.<anonymous> (test/unit/message-io-test.ts:551:7)
  1. Build the driver (npm run build).
> tedious@0.0.0-dev build
> rimraf lib && babel src --out-dir lib --extensions .js,.ts && npm run build:types

Successfully compiled 100 files with Babel (1642ms).

> tedious@0.0.0-dev build:types
> tsc --project tsconfig.build-types.json
  1. Run eslint and flow typechecker (npm run lint).
> tedious@0.0.0-dev lint
> eslint src test --ext .js,.ts && tsc
  1. Run commitlint (node_modules/.bin/commitlint --from origin/master --to HEAD). Refer commit conventions and commit rules.
# Had to install commitlint, still fails
⧗   input: feat: Add LOCK_TIMEOUT connection setting
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://commitlint.js.org/guides/getting-started
    - Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

Thank you for Contributing!

@etinquis etinquis changed the title Add connection setting for LOCK_TIMEOUT feat: Add LOCK_TIMEOUT connection setting Oct 11, 2025
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.82%. Comparing base (77800dd) to head (fa6d281).

Files with missing lines Patch % Lines
src/connection.ts 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1694      +/-   ##
==========================================
- Coverage   78.84%   78.82%   -0.02%     
==========================================
  Files          90       90              
  Lines        4887     4893       +6     
  Branches      920      923       +3     
==========================================
+ Hits         3853     3857       +4     
- Misses        736      737       +1     
- Partials      298      299       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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