@dxos/functions-testing 0.8.4-main.3c1ae3b → 0.8.4-main.937b3ca
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 +4 -3
- 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 +16 -13
- package/src/cpu-limit.test.ts +1 -1
- package/src/testing/util.ts +6 -4
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions-testing",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.937b3ca",
|
|
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
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "info@dxos.org",
|
|
9
13
|
"sideEffects": true,
|
|
@@ -33,19 +37,18 @@
|
|
|
33
37
|
"src"
|
|
34
38
|
],
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@effect/platform": "0.
|
|
37
|
-
"@dxos/async": "0.8.4-main.
|
|
38
|
-
"@dxos/client": "0.8.4-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/functions-runtime-cloudflare": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
40
|
+
"@effect/platform": "0.93.6",
|
|
41
|
+
"@dxos/async": "0.8.4-main.937b3ca",
|
|
42
|
+
"@dxos/client": "0.8.4-main.937b3ca",
|
|
43
|
+
"@dxos/config": "0.8.4-main.937b3ca",
|
|
44
|
+
"@dxos/functions": "0.8.4-main.937b3ca",
|
|
45
|
+
"@dxos/functions-runtime": "0.8.4-main.937b3ca",
|
|
46
|
+
"@dxos/echo": "0.8.4-main.937b3ca",
|
|
47
|
+
"@dxos/functions-runtime-cloudflare": "0.8.4-main.937b3ca",
|
|
48
|
+
"@dxos/log": "0.8.4-main.937b3ca",
|
|
49
|
+
"@dxos/protocols": "0.8.4-main.937b3ca",
|
|
50
|
+
"@dxos/invariant": "0.8.4-main.937b3ca"
|
|
47
51
|
},
|
|
48
|
-
"devDependencies": {},
|
|
49
52
|
"publishConfig": {
|
|
50
53
|
"access": "public"
|
|
51
54
|
},
|
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('break CPU limit through natural exection', { timeout: 520_000 }, async ({ expect }) => {
|
|
116
|
+
test.only('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 { type FunctionRuntimeKind } from '@dxos/protocols';
|
|
17
|
+
import { ErrorCodec, 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,7 +95,9 @@ export const observeInvocations = async (space: Space, maxCount: number | null)
|
|
|
95
95
|
count: count++,
|
|
96
96
|
begin: invocation,
|
|
97
97
|
});
|
|
98
|
-
console.log(
|
|
98
|
+
console.log(
|
|
99
|
+
`${count.toString().padStart(3, ' ')}: BEGIN ${invocation.runtime ?? '(unknown runtime)'} ${JSON.stringify(invocation.input)}`,
|
|
100
|
+
);
|
|
99
101
|
} else if (Obj.instanceOf(InvocationTraceEndEvent, invocation)) {
|
|
100
102
|
const data = invocationData.get(invocation.invocationId);
|
|
101
103
|
if (!data || !!data.end) {
|
|
@@ -107,8 +109,8 @@ export const observeInvocations = async (space: Space, maxCount: number | null)
|
|
|
107
109
|
console.log(
|
|
108
110
|
`${data.count.toString().padStart(3, ' ')}: END outcome=${outcome} duration=${data.end.timestamp - data.begin.timestamp}`,
|
|
109
111
|
);
|
|
110
|
-
if (outcome === 'failure') {
|
|
111
|
-
console.
|
|
112
|
+
if (outcome === 'failure' && data.end.error) {
|
|
113
|
+
console.error(ErrorCodec.decode(data.end.error));
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
}
|