velocious 1.0.619 → 1.0.620
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/configuration.js +1 -1
- package/build/environment-handlers/base.js +8 -0
- package/build/environment-handlers/node.js +12 -0
- package/build/src/configuration.js +2 -2
- package/build/src/environment-handlers/base.d.ts +7 -0
- package/build/src/environment-handlers/base.d.ts.map +1 -1
- package/build/src/environment-handlers/base.js +8 -1
- package/build/src/environment-handlers/node.d.ts +7 -0
- package/build/src/environment-handlers/node.d.ts.map +1 -1
- package/build/src/environment-handlers/node.js +12 -1
- package/build/src/testing/shared-transaction-connection-coordinator.d.ts +2 -0
- package/build/src/testing/shared-transaction-connection-coordinator.d.ts.map +1 -1
- package/build/src/testing/shared-transaction-connection-coordinator.js +79 -12
- package/build/src/testing/test.d.ts +1 -1
- package/build/src/testing/test.d.ts.map +1 -1
- package/build/src/testing/test.js +2 -2
- package/build/testing/shared-transaction-connection-coordinator.js +83 -10
- package/build/testing/test.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/configuration.js +1 -1
- package/src/environment-handlers/base.js +8 -0
- package/src/environment-handlers/node.js +12 -0
- package/src/testing/shared-transaction-connection-coordinator.js +83 -10
- package/src/testing/test.js +1 -1
- package/build/src/testing/wait-for-event.d.ts +0 -46
- package/build/src/testing/wait-for-event.d.ts.map +0 -1
- package/build/src/testing/wait-for-event.js +0 -64
- package/build/testing/wait-for-event.js +0 -72
- package/src/testing/wait-for-event.js +0 -72
package/README.md
CHANGED
|
@@ -259,7 +259,7 @@ npx velocious test:timing-manifest:merge --output tmp/test-timings.json \
|
|
|
259
259
|
See [test profiling](docs/test-profiling.md) for lifecycle accounting, custom
|
|
260
260
|
activity spans, schema, and privacy guarantees.
|
|
261
261
|
|
|
262
|
-
Prefer waiting for a real signal or condition over sleeping a fixed duration. `waitForEvent(emitter, eventName, {timeoutMs, filter})` resolves the instant a matching event fires (a background job finishing, a model update, a websocket message) and rejects on timeout; for polling an arbitrary condition, use awaitery's `waitFor`.
|
|
262
|
+
Prefer waiting for a real signal or condition over sleeping a fixed duration. `waitForEvent(emitter, eventName, {timeoutMs, filter})` resolves the instant a matching event fires (a background job finishing, a model update, a websocket message) and rejects on timeout; for polling an arbitrary condition, use awaitery's `waitFor`. The stable Velocious import remains `velocious/build/src/testing/test.js`; its generic `waitForEvent` primitive comes from `@velocious/testing`, while the keyed testing DSL and framework runner remain owned by Velocious.
|
|
263
263
|
|
|
264
264
|
```js
|
|
265
265
|
import {waitForEvent} from "velocious/build/src/testing/test.js"
|
package/build/configuration.js
CHANGED
|
@@ -3475,7 +3475,7 @@ export default class VelociousConfiguration {
|
|
|
3475
3475
|
* @returns {T} - Callback result.
|
|
3476
3476
|
*/
|
|
3477
3477
|
withoutCurrentConnectionContexts(callback) {
|
|
3478
|
-
let runCallback = callback
|
|
3478
|
+
let runCallback = () => this.getEnvironmentHandler().runWithoutSharedTransactionCoordinatorOwners(callback)
|
|
3479
3479
|
|
|
3480
3480
|
for (const pool of Object.values(this.databasePools)) {
|
|
3481
3481
|
if (!pool) continue
|
|
@@ -54,6 +54,14 @@ export default class VelociousEnvironmentHandlerBase {
|
|
|
54
54
|
*/
|
|
55
55
|
runWithSharedTransactionCoordinatorOwner(_connection, _owner, callback) { return callback() }
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Runs work without inherited shared-transaction coordinator ownership.
|
|
59
|
+
* @template T
|
|
60
|
+
* @param {() => T} callback - Detached work.
|
|
61
|
+
* @returns {T} - Callback result.
|
|
62
|
+
*/
|
|
63
|
+
runWithoutSharedTransactionCoordinatorOwners(callback) { return callback() }
|
|
64
|
+
|
|
57
65
|
/**
|
|
58
66
|
* Runs work with test-profile attribution. Runtimes without async-context
|
|
59
67
|
* storage execute the callback without installing ambient attribution.
|
|
@@ -154,6 +154,18 @@ export default class VelociousEnvironmentHandlerNode extends Base{
|
|
|
154
154
|
return this._sharedTransactionCoordinatorAsyncLocalStorage.run(owners, callback)
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Runs work without inherited shared-transaction coordinator ownership.
|
|
159
|
+
* @template T
|
|
160
|
+
* @param {() => T} callback - Detached work.
|
|
161
|
+
* @returns {T} - Callback result.
|
|
162
|
+
*/
|
|
163
|
+
runWithoutSharedTransactionCoordinatorOwners(callback) {
|
|
164
|
+
if (!this._sharedTransactionCoordinatorAsyncLocalStorage) return callback()
|
|
165
|
+
|
|
166
|
+
return this._sharedTransactionCoordinatorAsyncLocalStorage.run(new Map(), callback)
|
|
167
|
+
}
|
|
168
|
+
|
|
157
169
|
/**
|
|
158
170
|
* Runs work with async-safe test profile attribution.
|
|
159
171
|
* @template T
|