You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CockroachDB isolation tests hardcode the expected effective isolation level for “default
settings” but do not set/read the cluster settings that control CockroachDB’s fallback behavior,
making the assertions environment-dependent and prone to failure (e.g., REPEATABLE READ can run as
SERIALIZABLE when the repeatable-read setting is disabled). This can break CI or local runs
depending on the cluster’s configuration.
getExpectedIsolationForDefaultSettings only remaps READ UNCOMMITTED→READ COMMITTED and otherwise
assumes the requested level is the effective level; this is then used to assert the server’s
effective isolation in both the “supported” and “defined in data source” suites. However, the PR’s
own CockroachDB docs (and the test file’s own fallbackCases) state that the effective isolation
can change based on sql.txn.read_committed_isolation.enabled and
sql.txn.repeatable_read_isolation.enabled, which these suites do not control before asserting.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`cockroachdb-isolation.test.ts` asserts the effective isolation level returned by `SHOW TRANSACTION ISOLATION LEVEL`, but the expected values depend on CockroachDB cluster settings. The tests currently don’t set/read those settings for the “supported” and “defined in data source” suites, so results can vary by environment.
### Issue Context
CockroachDB may map requested weaker levels to stronger ones depending on:
- `sql.txn.read_committed_isolation.enabled`
- `sql.txn.repeatable_read_isolation.enabled`
The test file already encodes this dependency in `fallbackCases`, but other suites still assume a fixed default mapping.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[29-37]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[66-83]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[164-175]
### Suggested fix
Choose one deterministic approach:
1) **Set known cluster settings** in `before()` hooks for the “supported” and “defined in data source” suites (e.g., enable `readCommitted` and `repeatableRead`) and update expected mapping accordingly.
OR
2) **Compute expected effective isolation dynamically** by querying current cluster settings (e.g., `SHOW CLUSTER SETTING ...`) and using the same mapping rules as `fallbackCases` for assertions.
Either way, avoid assuming “default settings” without enforcing or reading them.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Cluster setting not restored 🐞 Bug☼ Reliability
Description
The CockroachDB isolation fallback tests change cluster-wide settings via SET CLUSTER SETTING ...
and never reset them, leaving sql.txn.repeatable_read_isolation.enabled disabled after the suite
completes. This can change behavior of later CockroachDB tests against the same cluster and make the
test run order-dependent/flaky.
The fallback suite’s last case sets repeatableRead: false, and each case applies the settings with
SET CLUSTER SETTING; there is no after/afterEach hook to restore the previous values.
Separately, the shared test harness enables sql.txn.repeatable_read_isolation.enabled = 'true'
during CockroachDB connection setup, implying other tests may assume it remains enabled unless
explicitly changed and reset.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts` modifies CockroachDB *cluster-wide* settings in the "fallback behavior" suite but never restores them. Because these settings are global, they can leak into subsequent CockroachDB tests and make the suite order-dependent/flaky.
### Issue Context
The last fallback case sets `sql.txn.repeatable_read_isolation.enabled` to `false`, and the suite ends without resetting it. The test harness (`test/utils/test-utils.ts`) enables `sql.txn.repeatable_read_isolation.enabled = 'true'` during CockroachDB setup, suggesting other tests may rely on that baseline.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[183-290]
### Suggested fix
- Capture the original values at the start of the "fallback behavior" describe block (e.g., `SHOW CLUSTER SETTING sql.txn.read_committed_isolation.enabled` and `SHOW CLUSTER SETTING sql.txn.repeatable_read_isolation.enabled`).
- Add an `afterEach` (or at minimum `after`) hook that restores both settings back to their original values (or to the known baseline used by the test harness, e.g. `readCommitted=true`, `repeatableRead=true`).
- Ensure restoration happens even if a test fails (prefer `afterEach`).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CockroachDB section says REPEATABLE READ is available behind
sql.txn.repeatable_read_isolation.enabled, but it also states CockroachDB “does not implement
weaker isolation levels at all” and ignores weaker requests. This contradiction makes the
documentation incorrect/confusing about when REPEATABLE READ is actually honored.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)- `SERIALIZABLE` (default)
CockroachDB does not implement weaker isolation levels at all. When you request `READ UNCOMMITTED` or `REPEATABLE READ` via SQL (e.g. `BEGIN TRANSACTION ISOLATION LEVEL READ UNCOMMITTED`), CockroachDB accepts the syntax, silently ignores the requested weakness, and runs the transaction at a stricter level instead — no warning, no error:
Evidence
The doc first introduces REPEATABLE READ as a configurable isolation level (behind a cluster
setting), then immediately claims CockroachDB does not implement weaker isolation levels at all,
which conflicts with the earlier statement. Repo test setup also explicitly enables the REPEATABLE
READ cluster setting, reinforcing that this repo expects an enabled mode to exist.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The CockroachDB docs are internally inconsistent: they say `REPEATABLE READ` exists behind `sql.txn.repeatable_read_isolation.enabled`, but also claim CockroachDB does not implement weaker isolation levels at all and ignores weaker requests.
### Issue Context
This section is meant to explain how CockroachDB interprets requested isolation levels; it needs to distinguish behavior when the feature flag is enabled vs disabled.
### Fix Focus Areas
- docs/docs/transactions.mdx[63-71]
### Suggested change
Adjust the blanket statement to be conditional (e.g., describe historical behavior / behavior when the relevant cluster settings are disabled), so it does not contradict the preceding bullet list.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
4. Inconsistent dash in CockroachDB docs 📘 Rule violation⚙ Maintainability
Description
The new REPEATABLE READ bullet uses a hyphen (-) instead of the em dash (—) used by the
surrounding items, introducing inconsistent style in the same list. This violates the requirement to
avoid style inconsistent with the file.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)
Evidence
PR Compliance ID 4 forbids introducing style inconsistent with the file; the added REPEATABLE READ
list item uses - while adjacent items use — in the same CockroachDB isolation level list.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
In `docs/docs/transactions.mdx`, the added CockroachDB isolation level bullet for `REPEATABLE READ` uses `-` as the separator, while the neighboring bullets use an em dash (`—`). This creates an inconsistent style within the same list.
## Issue Context
The compliance checklist requires avoiding style inconsistent with the file.
## Fix Focus Areas
- docs/docs/transactions.mdx[64-64]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
5. Cleanup can skip connection close 🐞 Bug☼ Reliability
Description
The fallback suite’s async after-hook performs cluster-setting updates before closing connections,
so if any SET CLUSTER SETTING query fails the connections won’t be closed. This can leave open
handles and make the test run hang or cascade failures.
The after-hook awaits Promise.all of setIsolationClusterSettings, then closes connections; a
rejection from the first step prevents closeTestingConnections from running. This is a new risk
introduced by adding extra async cleanup logic to the after-hook.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
If resetting CockroachDB cluster settings fails in the fallback suite’s `after()` hook, `closeTestingConnections()` is skipped.
### Issue Context
The after-hook performs multiple awaited operations; cleanup should be resilient so connections are always closed.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[194-204]
### Proposed fix
Wrap the reset block in a `try { ... } finally { await closeTestingConnections(dataSources) }` so connections are closed even if `setIsolationClusterSettings` throws/rejects.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Author self-review: I have reviewed the code review findings, and addressed the relevant ones.
The CockroachDB isolation tests hardcode the expected effective isolation level for “default
settings” but do not set/read the cluster settings that control CockroachDB’s fallback behavior,
making the assertions environment-dependent and prone to failure (e.g., REPEATABLE READ can run as
SERIALIZABLE when the repeatable-read setting is disabled). This can break CI or local runs
depending on the cluster’s configuration.
getExpectedIsolationForDefaultSettings only remaps READ UNCOMMITTED→READ COMMITTED and otherwise
assumes the requested level is the effective level; this is then used to assert the server’s
effective isolation in both the “supported” and “defined in data source” suites. However, the PR’s
own CockroachDB docs (and the test file’s own fallbackCases) state that the effective isolation
can change based on sql.txn.read_committed_isolation.enabled and
sql.txn.repeatable_read_isolation.enabled, which these suites do not control before asserting.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`cockroachdb-isolation.test.ts` asserts the effective isolation level returned by `SHOW TRANSACTION ISOLATION LEVEL`, but the expected values depend on CockroachDB cluster settings. The tests currently don’t set/read those settings for the “supported” and “defined in data source” suites, so results can vary by environment.
### Issue Context
CockroachDB may map requested weaker levels to stronger ones depending on:
- `sql.txn.read_committed_isolation.enabled`
- `sql.txn.repeatable_read_isolation.enabled`
The test file already encodes this dependency in `fallbackCases`, but other suites still assume a fixed default mapping.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[29-37]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[66-83]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[164-175]
### Suggested fix
Choose one deterministic approach:
1) **Set known cluster settings** in `before()` hooks for the “supported” and “defined in data source” suites (e.g., enable `readCommitted` and `repeatableRead`) and update expected mapping accordingly.
OR
2) **Compute expected effective isolation dynamically** by querying current cluster settings (e.g., `SHOW CLUSTER SETTING ...`) and using the same mapping rules as `fallbackCases` for assertions.
Either way, avoid assuming “default settings” without enforcing or reading them.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Cluster setting not restored 🐞 Bug☼ Reliability
Description
The CockroachDB isolation fallback tests change cluster-wide settings via SET CLUSTER SETTING ...
and never reset them, leaving sql.txn.repeatable_read_isolation.enabled disabled after the suite
completes. This can change behavior of later CockroachDB tests against the same cluster and make the
test run order-dependent/flaky.
The fallback suite’s last case sets repeatableRead: false, and each case applies the settings with
SET CLUSTER SETTING; there is no after/afterEach hook to restore the previous values.
Separately, the shared test harness enables sql.txn.repeatable_read_isolation.enabled = 'true'
during CockroachDB connection setup, implying other tests may assume it remains enabled unless
explicitly changed and reset.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts` modifies CockroachDB *cluster-wide* settings in the "fallback behavior" suite but never restores them. Because these settings are global, they can leak into subsequent CockroachDB tests and make the suite order-dependent/flaky.
### Issue Context
The last fallback case sets `sql.txn.repeatable_read_isolation.enabled` to `false`, and the suite ends without resetting it. The test harness (`test/utils/test-utils.ts`) enables `sql.txn.repeatable_read_isolation.enabled = 'true'` during CockroachDB setup, suggesting other tests may rely on that baseline.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[183-290]
### Suggested fix
- Capture the original values at the start of the "fallback behavior" describe block (e.g., `SHOW CLUSTER SETTING sql.txn.read_committed_isolation.enabled` and `SHOW CLUSTER SETTING sql.txn.repeatable_read_isolation.enabled`).
- Add an `afterEach` (or at minimum `after`) hook that restores both settings back to their original values (or to the known baseline used by the test harness, e.g. `readCommitted=true`, `repeatableRead=true`).
- Ensure restoration happens even if a test fails (prefer `afterEach`).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CockroachDB section says REPEATABLE READ is available behind
sql.txn.repeatable_read_isolation.enabled, but it also states CockroachDB “does not implement
weaker isolation levels at all” and ignores weaker requests. This contradiction makes the
documentation incorrect/confusing about when REPEATABLE READ is actually honored.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)- `SERIALIZABLE` (default)
CockroachDB does not implement weaker isolation levels at all. When you request `READ UNCOMMITTED` or `REPEATABLE READ` via SQL (e.g. `BEGIN TRANSACTION ISOLATION LEVEL READ UNCOMMITTED`), CockroachDB accepts the syntax, silently ignores the requested weakness, and runs the transaction at a stricter level instead — no warning, no error:
Evidence
The doc first introduces REPEATABLE READ as a configurable isolation level (behind a cluster
setting), then immediately claims CockroachDB does not implement weaker isolation levels at all,
which conflicts with the earlier statement. Repo test setup also explicitly enables the REPEATABLE
READ cluster setting, reinforcing that this repo expects an enabled mode to exist.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The CockroachDB docs are internally inconsistent: they say `REPEATABLE READ` exists behind `sql.txn.repeatable_read_isolation.enabled`, but also claim CockroachDB does not implement weaker isolation levels at all and ignores weaker requests.
### Issue Context
This section is meant to explain how CockroachDB interprets requested isolation levels; it needs to distinguish behavior when the feature flag is enabled vs disabled.
### Fix Focus Areas
- docs/docs/transactions.mdx[63-71]
### Suggested change
Adjust the blanket statement to be conditional (e.g., describe historical behavior / behavior when the relevant cluster settings are disabled), so it does not contradict the preceding bullet list.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
4. Inconsistent dash in CockroachDB docs 📘 Rule violation⚙ Maintainability
Description
The new REPEATABLE READ bullet uses a hyphen (-) instead of the em dash (—) used by the
surrounding items, introducing inconsistent style in the same list. This violates the requirement to
avoid style inconsistent with the file.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)
Evidence
PR Compliance ID 4 forbids introducing style inconsistent with the file; the added REPEATABLE READ
list item uses - while adjacent items use — in the same CockroachDB isolation level list.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
In `docs/docs/transactions.mdx`, the added CockroachDB isolation level bullet for `REPEATABLE READ` uses `-` as the separator, while the neighboring bullets use an em dash (`—`). This creates an inconsistent style within the same list.
## Issue Context
The compliance checklist requires avoiding style inconsistent with the file.
## Fix Focus Areas
- docs/docs/transactions.mdx[64-64]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
5. Cleanup can skip connection close 🐞 Bug☼ Reliability
Description
The fallback suite’s async after-hook performs cluster-setting updates before closing connections,
so if any SET CLUSTER SETTING query fails the connections won’t be closed. This can leave open
handles and make the test run hang or cascade failures.
The after-hook awaits Promise.all of setIsolationClusterSettings, then closes connections; a
rejection from the first step prevents closeTestingConnections from running. This is a new risk
introduced by adding extra async cleanup logic to the after-hook.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
If resetting CockroachDB cluster settings fails in the fallback suite’s `after()` hook, `closeTestingConnections()` is skipped.
### Issue Context
The after-hook performs multiple awaited operations; cleanup should be resilient so connections are always closed.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[194-204]
### Proposed fix
Wrap the reset block in a `try { ... } finally { await closeTestingConnections(dataSources) }` so connections are closed even if `setIsolationClusterSettings` throws/rejects.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CockroachDB isolation tests hardcode the expected effective isolation level for “default
settings” but do not set/read the cluster settings that control CockroachDB’s fallback behavior,
making the assertions environment-dependent and prone to failure (e.g., REPEATABLE READ can run as
SERIALIZABLE when the repeatable-read setting is disabled). This can break CI or local runs
depending on the cluster’s configuration.
getExpectedIsolationForDefaultSettings only remaps READ UNCOMMITTED→READ COMMITTED and otherwise
assumes the requested level is the effective level; this is then used to assert the server’s
effective isolation in both the “supported” and “defined in data source” suites. However, the PR’s
own CockroachDB docs (and the test file’s own fallbackCases) state that the effective isolation
can change based on sql.txn.read_committed_isolation.enabled and
sql.txn.repeatable_read_isolation.enabled, which these suites do not control before asserting.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`cockroachdb-isolation.test.ts` asserts the effective isolation level returned by `SHOW TRANSACTION ISOLATION LEVEL`, but the expected values depend on CockroachDB cluster settings. The tests currently don’t set/read those settings for the “supported” and “defined in data source” suites, so results can vary by environment.
### Issue Context
CockroachDB may map requested weaker levels to stronger ones depending on:
- `sql.txn.read_committed_isolation.enabled`
- `sql.txn.repeatable_read_isolation.enabled`
The test file already encodes this dependency in `fallbackCases`, but other suites still assume a fixed default mapping.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[29-37]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[66-83]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[164-175]
### Suggested fix
Choose one deterministic approach:
1) **Set known cluster settings** in `before()` hooks for the “supported” and “defined in data source” suites (e.g., enable `readCommitted` and `repeatableRead`) and update expected mapping accordingly.
OR
2) **Compute expected effective isolation dynamically** by querying current cluster settings (e.g., `SHOW CLUSTER SETTING ...`) and using the same mapping rules as `fallbackCases` for assertions.
Either way, avoid assuming “default settings” without enforcing or reading them.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Cluster setting not restored 🐞 Bug☼ Reliability
Description
The CockroachDB isolation fallback tests change cluster-wide settings via SET CLUSTER SETTING ...
and never reset them, leaving sql.txn.repeatable_read_isolation.enabled disabled after the suite
completes. This can change behavior of later CockroachDB tests against the same cluster and make the
test run order-dependent/flaky.
The fallback suite’s last case sets repeatableRead: false, and each case applies the settings with
SET CLUSTER SETTING; there is no after/afterEach hook to restore the previous values.
Separately, the shared test harness enables sql.txn.repeatable_read_isolation.enabled = 'true'
during CockroachDB connection setup, implying other tests may assume it remains enabled unless
explicitly changed and reset.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts` modifies CockroachDB *cluster-wide* settings in the "fallback behavior" suite but never restores them. Because these settings are global, they can leak into subsequent CockroachDB tests and make the suite order-dependent/flaky.
### Issue Context
The last fallback case sets `sql.txn.repeatable_read_isolation.enabled` to `false`, and the suite ends without resetting it. The test harness (`test/utils/test-utils.ts`) enables `sql.txn.repeatable_read_isolation.enabled = 'true'` during CockroachDB setup, suggesting other tests may rely on that baseline.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[183-290]
### Suggested fix
- Capture the original values at the start of the "fallback behavior" describe block (e.g., `SHOW CLUSTER SETTING sql.txn.read_committed_isolation.enabled` and `SHOW CLUSTER SETTING sql.txn.repeatable_read_isolation.enabled`).
- Add an `afterEach` (or at minimum `after`) hook that restores both settings back to their original values (or to the known baseline used by the test harness, e.g. `readCommitted=true`, `repeatableRead=true`).
- Ensure restoration happens even if a test fails (prefer `afterEach`).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CockroachDB section says REPEATABLE READ is available behind
sql.txn.repeatable_read_isolation.enabled, but it also states CockroachDB “does not implement
weaker isolation levels at all” and ignores weaker requests. This contradiction makes the
documentation incorrect/confusing about when REPEATABLE READ is actually honored.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)- `SERIALIZABLE` (default)
CockroachDB does not implement weaker isolation levels at all. When you request `READ UNCOMMITTED` or `REPEATABLE READ` via SQL (e.g. `BEGIN TRANSACTION ISOLATION LEVEL READ UNCOMMITTED`), CockroachDB accepts the syntax, silently ignores the requested weakness, and runs the transaction at a stricter level instead — no warning, no error:
Evidence
The doc first introduces REPEATABLE READ as a configurable isolation level (behind a cluster
setting), then immediately claims CockroachDB does not implement weaker isolation levels at all,
which conflicts with the earlier statement. Repo test setup also explicitly enables the REPEATABLE
READ cluster setting, reinforcing that this repo expects an enabled mode to exist.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The CockroachDB docs are internally inconsistent: they say `REPEATABLE READ` exists behind `sql.txn.repeatable_read_isolation.enabled`, but also claim CockroachDB does not implement weaker isolation levels at all and ignores weaker requests.
### Issue Context
This section is meant to explain how CockroachDB interprets requested isolation levels; it needs to distinguish behavior when the feature flag is enabled vs disabled.
### Fix Focus Areas
- docs/docs/transactions.mdx[63-71]
### Suggested change
Adjust the blanket statement to be conditional (e.g., describe historical behavior / behavior when the relevant cluster settings are disabled), so it does not contradict the preceding bullet list.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
4. Inconsistent dash in CockroachDB docs 📘 Rule violation⚙ Maintainability
Description
The new REPEATABLE READ bullet uses a hyphen (-) instead of the em dash (—) used by the
surrounding items, introducing inconsistent style in the same list. This violates the requirement to
avoid style inconsistent with the file.
+- `REPEATABLE READ` - requires the cluster setting `sql.txn.repeatable_read_isolation.enabled`, which is disabled by default (introduced in v24.3.0)
Evidence
PR Compliance ID 4 forbids introducing style inconsistent with the file; the added REPEATABLE READ
list item uses - while adjacent items use — in the same CockroachDB isolation level list.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
In `docs/docs/transactions.mdx`, the added CockroachDB isolation level bullet for `REPEATABLE READ` uses `-` as the separator, while the neighboring bullets use an em dash (`—`). This creates an inconsistent style within the same list.
## Issue Context
The compliance checklist requires avoiding style inconsistent with the file.
## Fix Focus Areas
- docs/docs/transactions.mdx[64-64]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
5. Cleanup can skip connection close 🐞 Bug☼ Reliability
Description
The fallback suite’s async after-hook performs cluster-setting updates before closing connections,
so if any SET CLUSTER SETTING query fails the connections won’t be closed. This can leave open
handles and make the test run hang or cascade failures.
The after-hook awaits Promise.all of setIsolationClusterSettings, then closes connections; a
rejection from the first step prevents closeTestingConnections from running. This is a new risk
introduced by adding extra async cleanup logic to the after-hook.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
If resetting CockroachDB cluster settings fails in the fallback suite’s `after()` hook, `closeTestingConnections()` is skipped.
### Issue Context
The after-hook performs multiple awaited operations; cleanup should be resilient so connections are always closed.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[194-204]
### Proposed fix
Wrap the reset block in a `try { ... } finally { await closeTestingConnections(dataSources) }` so connections are closed even if `setIsolationClusterSettings` throws/rejects.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CockroachDB isolation tests hardcode the expected effective isolation level for “default
settings” but do not set/read the cluster settings that control CockroachDB’s fallback behavior,
making the assertions environment-dependent and prone to failure (e.g., REPEATABLE READ can run as
SERIALIZABLE when the repeatable-read setting is disabled). This can break CI or local runs
depending on the cluster’s configuration.
getExpectedIsolationForDefaultSettings only remaps READ UNCOMMITTED→READ COMMITTED and otherwise
assumes the requested level is the effective level; this is then used to assert the server’s
effective isolation in both the “supported” and “defined in data source” suites. However, the PR’s
own CockroachDB docs (and the test file’s own fallbackCases) state that the effective isolation
can change based on sql.txn.read_committed_isolation.enabled and
sql.txn.repeatable_read_isolation.enabled, which these suites do not control before asserting.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`cockroachdb-isolation.test.ts` asserts the effective isolation level returned by `SHOW TRANSACTION ISOLATION LEVEL`, but the expected values depend on CockroachDB cluster settings. The tests currently don’t set/read those settings for the “supported” and “defined in data source” suites, so results can vary by environment.
### Issue Context
CockroachDB may map requested weaker levels to stronger ones depending on:
- `sql.txn.read_committed_isolation.enabled`
- `sql.txn.repeatable_read_isolation.enabled`
The test file already encodes this dependency in `fallbackCases`, but other suites still assume a fixed default mapping.
### Fix Focus Areas
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[29-37]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[66-83]
- test/functional/transaction/isolation-level/cockroachdb-isolation.test.ts[164-175]
### Suggested fix
Choose one deterministic approach:
1) **Set known cluster settings** in `before()` hooks for the “supported” and “defined in data source” suites (e.g., enable `readCommitted` and `repeatableRead`) and update expected mapping accordingly.
OR
2) **Compute expected effective isolation dynamically** by querying current cluster settings (e.g., `SHOW CLUSTER SETTING ...`) and using the same mapping rules as `fallbackCases` for assertions.
Either way, avoid assuming “default settings” without enforcing or reading them.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Cluster setting not restored 🐞 Bug☼ Reliability
Description
The CockroachDB isolation fallback tests change cluster-wide settings via SET CLUSTER SETTING ...
and never reset them, leaving sql.txn.repeatable_read_isolation.enabled disabled after the suite
completes. This can change behavior of later CockroachDB tests against the same cluster and make the
test run order-dependent/flaky.
The fallback suite’s last case sets repeatableRead: false, and each case applies the settings with
SET CLUSTER SETTING; there is no after/afterEach hook to restore the previous values.
Separate...
Cprakhar
changed the title
test(transactions): clarify CockroachDB isolation level behavior and add tests
docs(transactions): clarify CockroachDB isolation level behavior and add tests
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choreNon-user-facing maintenance: CI, lint, refactor, test scaffolding, dev toolingdocumentation
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
Add weaker isolation behavior with added transaction tests.
masterbranchFixes #00000tests/**.test.ts)docs/docs/**.md)