@dxos/functions-testing 0.8.4-main.21d9917 → 0.8.4-main.3c1ae3b
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/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +3 -4
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -16
- package/src/cpu-limit.test.ts +1 -1
- package/src/testing/util.ts +4 -6
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions-testing",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.3c1ae3b",
|
|
4
4
|
"description": "Functions tests",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/dxos/dxos"
|
|
10
|
-
},
|
|
11
7
|
"license": "MIT",
|
|
12
8
|
"author": "info@dxos.org",
|
|
13
9
|
"sideEffects": true,
|
|
@@ -37,18 +33,19 @@
|
|
|
37
33
|
"src"
|
|
38
34
|
],
|
|
39
35
|
"dependencies": {
|
|
40
|
-
"@effect/platform": "0.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/echo": "0.8.4-main.
|
|
46
|
-
"@dxos/functions-runtime
|
|
47
|
-
"@dxos/functions-runtime": "0.8.4-main.
|
|
48
|
-
"@dxos/invariant": "0.8.4-main.
|
|
49
|
-
"@dxos/log": "0.8.4-main.
|
|
50
|
-
"@dxos/protocols": "0.8.4-main.
|
|
36
|
+
"@effect/platform": "0.92.1",
|
|
37
|
+
"@dxos/async": "0.8.4-main.3c1ae3b",
|
|
38
|
+
"@dxos/client": "0.8.4-main.3c1ae3b",
|
|
39
|
+
"@dxos/functions": "0.8.4-main.3c1ae3b",
|
|
40
|
+
"@dxos/config": "0.8.4-main.3c1ae3b",
|
|
41
|
+
"@dxos/echo": "0.8.4-main.3c1ae3b",
|
|
42
|
+
"@dxos/functions-runtime": "0.8.4-main.3c1ae3b",
|
|
43
|
+
"@dxos/functions-runtime-cloudflare": "0.8.4-main.3c1ae3b",
|
|
44
|
+
"@dxos/invariant": "0.8.4-main.3c1ae3b",
|
|
45
|
+
"@dxos/log": "0.8.4-main.3c1ae3b",
|
|
46
|
+
"@dxos/protocols": "0.8.4-main.3c1ae3b"
|
|
51
47
|
},
|
|
48
|
+
"devDependencies": {},
|
|
52
49
|
"publishConfig": {
|
|
53
50
|
"access": "public"
|
|
54
51
|
},
|
package/src/cpu-limit.test.ts
CHANGED
|
@@ -113,7 +113,7 @@ describe.runIf(process.env.DX_TEST_TAGS?.includes('functions-e2e'))('CPU limit',
|
|
|
113
113
|
await observeInvocations(space, 100);
|
|
114
114
|
});
|
|
115
115
|
|
|
116
|
-
test
|
|
116
|
+
test('break CPU limit through natural exection', { timeout: 520_000 }, async ({ expect }) => {
|
|
117
117
|
const { client, space, functionsServiceClient } = await setup(config);
|
|
118
118
|
const func = await deployFunction(
|
|
119
119
|
space,
|
package/src/testing/util.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { InvocationTraceEndEvent, InvocationTraceStartEvent } from '@dxos/functi
|
|
|
14
14
|
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
15
15
|
import { bundleFunction } from '@dxos/functions-runtime/native';
|
|
16
16
|
import type { BundleResult } from '@dxos/functions-runtime/native';
|
|
17
|
-
import {
|
|
17
|
+
import { type FunctionRuntimeKind } from '@dxos/protocols';
|
|
18
18
|
import { EdgeReplicationSetting } from '@dxos/protocols/proto/dxos/echo/metadata';
|
|
19
19
|
|
|
20
20
|
export const writeBundle = (path: string, bundle: BundleResult) => {
|
|
@@ -95,9 +95,7 @@ export const observeInvocations = async (space: Space, maxCount: number | null)
|
|
|
95
95
|
count: count++,
|
|
96
96
|
begin: invocation,
|
|
97
97
|
});
|
|
98
|
-
console.log(
|
|
99
|
-
`${count.toString().padStart(3, ' ')}: BEGIN ${invocation.runtime ?? '(unknown runtime)'} ${JSON.stringify(invocation.input)}`,
|
|
100
|
-
);
|
|
98
|
+
console.log(`${count.toString().padStart(3, ' ')}: BEGIN ${JSON.stringify(invocation.input)}`);
|
|
101
99
|
} else if (Obj.instanceOf(InvocationTraceEndEvent, invocation)) {
|
|
102
100
|
const data = invocationData.get(invocation.invocationId);
|
|
103
101
|
if (!data || !!data.end) {
|
|
@@ -109,8 +107,8 @@ export const observeInvocations = async (space: Space, maxCount: number | null)
|
|
|
109
107
|
console.log(
|
|
110
108
|
`${data.count.toString().padStart(3, ' ')}: END outcome=${outcome} duration=${data.end.timestamp - data.begin.timestamp}`,
|
|
111
109
|
);
|
|
112
|
-
if (outcome === 'failure'
|
|
113
|
-
console.
|
|
110
|
+
if (outcome === 'failure') {
|
|
111
|
+
console.log(data.end.error?.stack);
|
|
114
112
|
}
|
|
115
113
|
}
|
|
116
114
|
}
|