From db8f883389bc6e23db28cd00b0a84c2893b2a74b Mon Sep 17 00:00:00 2001 From: bluepal-yaswanth-peravali Date: Tue, 21 Jul 2026 10:59:01 +0530 Subject: [PATCH 1/5] DE-1179 | Updated driver to latest typescript 7 --- .circleci/README.md | 21 ++++++++--- .circleci/config.yml | 70 ++++++++++++++++++++++++++++++++++- CHANGELOG.md | 12 ++++++ compat-test/package.json | 13 +++++++ compat-test/sample-imports.ts | 15 ++++++++ compat-test/tsconfig.json | 13 +++++++ package.json | 5 ++- tsconfig.cjs.json | 2 +- tsconfig.json | 3 +- typedoc.json | 1 + 10 files changed, 145 insertions(+), 10 deletions(-) create mode 100644 compat-test/package.json create mode 100644 compat-test/sample-imports.ts create mode 100644 compat-test/tsconfig.json diff --git a/.circleci/README.md b/.circleci/README.md index fb169b197..7363e710b 100644 --- a/.circleci/README.md +++ b/.circleci/README.md @@ -9,7 +9,7 @@ CircleCI validates **arangojs** using one parameterized job, `**node-test`**, wi | Pipeline parameter `docker-img` | Workflows | DB / coverage | | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -| **Empty** (default) | `**integration-single-topology`**, `**integration-cluster-topology**`, `**integration-http-proto-smoke**`, `**browser-smoke**` | **36** jobs total. | +| **Empty** (default) | `**integration-single-topology`**, `**integration-cluster-topology**`, `**integration-http-proto-smoke**`, `**browser-smoke**`, `**compat-typescript**` | **40** jobs total (36 DB/browser + 4 TypeScript consumer compat). | | **Non-empty** | **`integration-tests-given-db-image`**, **`integration-http-proto-smoke-given-db-image`**, **`browser-smoke-given-db-image`** | **19** jobs total (16 + 2 + 1); same split as the default pipeline | ### Secrets and context @@ -44,9 +44,9 @@ All integration and browser jobs attach **`context: docker-hub`**. --- -## 2) Default pipeline (`docker-img` empty) — **36 jobs** +## 2) Default pipeline (`docker-img` empty) — **40 jobs** -Four workflows run in parallel (`when: not <>`). +Five workflows run in parallel (`when: not <>`). ### A) `integration-single-topology` (**16** jobs) @@ -96,7 +96,18 @@ Puppeteer + `smoke-test.mjs` (esbuild browser bundle, `db.version()` in headless **Naming:** `browser-smoke-312`, `browser-smoke-4.0-nightly` -**Grand total (empty `docker-img`):** 16 + 16 + 2 + 2 = **36** jobs. +### E) `compat-typescript` — **4 jobs** (no ArangoDB / Docker) + +Builds and packs the publishable driver tarball once, then typechecks it as a consumer on TypeScript **5.4**, **6.0**, and **7.0** (see `compat-test/`). + +| Job | Role | +| --- | ---- | +| **`compat-pack`** | `npm install --ignore-scripts`, `npm run build`, `npm pack` → workspace `arangojs-pack.tgz` | +| **`compat-consumer-ts5`** | Install pack + `typescript@5.4.5`, `npx tsc --noEmit` | +| **`compat-consumer-ts6`** | Install pack + `typescript@6.0.3`, `npx tsc --noEmit` | +| **`compat-consumer-ts7`** | Install pack + `typescript@7.0.2`, `npx tsc --noEmit` | + +**Grand total (empty `docker-img`):** 16 + 16 + 2 + 2 + 4 = **40** jobs. --- @@ -182,7 +193,7 @@ Same Docker setup and **`login-docker-hub`** → **`start-db`** (single, HTTP) a ### Default (PR / push) - Do **not** set `docker-img`. -- Runs **36** jobs across the four workflows above (single matrix + cluster matrix + HTTP proto smoke + browser smoke). +- Runs **40** jobs across the five workflows above (single matrix + cluster matrix + HTTP proto smoke + browser smoke + TypeScript consumer compat). ### Custom DB image diff --git a/.circleci/config.yml b/.circleci/config.yml index 93494bfdf..7cbd0672f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -216,6 +216,51 @@ jobs: PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome-stable ARANGO_PROXY_TARGET: 172.28.0.1:8529 + # Build the driver with the repo toolchain (TypeScript 7) and pack the publishable + # tarball. No ArangoDB / Docker needed. + compat-pack: + executor: n22 + steps: + - checkout + - run: + name: Install jq + command: sudo apt-get update && sudo apt-get install -y --no-install-recommends jq + - run: + name: Install dependencies + command: npm install --ignore-scripts + - run: + name: Build and pack publishable tarball + command: | + set -euo pipefail + npm run build + cd build + npm pack + mv arangojs-*.tgz ../arangojs-pack.tgz + - persist_to_workspace: + root: . + paths: + - arangojs-pack.tgz + + # Install the packed tarball in a sample consumer project and typecheck it with a + # specific TypeScript version, simulating a customer on that version. + compat-consumer: + parameters: + ts: + type: string + executor: n22 + steps: + - checkout + - attach_workspace: + at: /tmp/workspace + - run: + name: Typecheck as TypeScript << parameters.ts >> consumer + working_directory: compat-test + command: | + set -euo pipefail + npm install --save-dev typescript@<< parameters.ts >> @types/node@20 + npm install --save arangojs@file:/tmp/workspace/arangojs-pack.tgz + npx tsc --noEmit + workflows: # 16 jobs: single-server only. HTTP/1.1 (default http_proto). 2 DB × 2 Node × 2 SSL × 2 module systems. integration-single-topology: @@ -425,4 +470,27 @@ workflows: filters: branches: ignore: stable - docker-img: <> \ No newline at end of file + docker-img: <> + + # Consumer TypeScript compat: build+pack once (TS 7), then typecheck the tarball with + # TS 5, TS 6, and TS 7 in parallel. + compat-typescript: + when: + not: <> + jobs: + - compat-pack + - compat-consumer: + name: compat-consumer-ts5 + ts: '5.4.5' + requires: + - compat-pack + - compat-consumer: + name: compat-consumer-ts6 + ts: '6.0.3' + requires: + - compat-pack + - compat-consumer: + name: compat-consumer-ts7 + ts: '7.0.2' + requires: + - compat-pack diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea14120d..316e922ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,18 @@ This driver uses semantic versioning: Next.js 15 production builds when using `next/headers` `cookies()` ([#831](https://github.com/arangodb/arangojs/issues/831)). Do not enable this when using undici 8.x unless required — it restores explicit `Content-Length` handling that can conflict with strict undici header validation. +- CI: CircleCI `compat-typescript` workflow builds/packs the driver once and typechecks the + publishable tarball as a TypeScript **5.4**, **6.0**, and **7.0** consumer (`compat-test/`). + +### Changed + +- Dev: Builds use **TypeScript 7** (`@typescript/native` → `typescript@^7.0.2`) for `tsc`. The + `typescript` package is aliased to `@typescript/typescript6` so tools that still need the + TypeScript 6 programmatic API (TypeDoc, typescript-eslint) keep working until a TS 7 API ships. +- Dev: Set explicit `compilerOptions.types` (`node`, `mocha`) for TS 6/7’s stricter `@types` + handling. CJS build uses `moduleResolution: "Bundler"` with `module: "CommonJS"` (replaces + deprecated `node10` / `"Node"` resolution). +- Dev: Upgraded TypeDoc to **0.28.20** for TypeScript 6 peer compatibility (docs generation). ### Deprecated diff --git a/compat-test/package.json b/compat-test/package.json new file mode 100644 index 000000000..07266f266 --- /dev/null +++ b/compat-test/package.json @@ -0,0 +1,13 @@ +{ + "name": "arangojs-compat-test", + "private": true, + "type": "module", + "description": "Consumer compatibility smoke test for published arangojs types (see the compat-typescript workflow in .circleci/config.yml)", + "devDependencies": { + "@types/node": "^20.19.43", + "typescript": "^7.0.2" + }, + "dependencies": { + "arangojs": "file:../arangojs-pack.tgz" + } +} diff --git a/compat-test/sample-imports.ts b/compat-test/sample-imports.ts new file mode 100644 index 000000000..fca1c18db --- /dev/null +++ b/compat-test/sample-imports.ts @@ -0,0 +1,15 @@ +/** + * Minimal consumer app: typecheck only (no runtime / no ArangoDB). + * Simulates a project that depends on the published arangojs package. + */ +import arangojs, { aql, Database } from "arangojs"; + +const db: Database = arangojs({ + url: "http://127.0.0.1:8529", + databaseName: "_system", +}); + +const query = aql`RETURN ${1}`; + +void db; +void query; diff --git a/compat-test/tsconfig.json b/compat-test/tsconfig.json new file mode 100644 index 000000000..4e40f5794 --- /dev/null +++ b/compat-test/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "noEmit": true, + "skipLibCheck": false, + "esModuleInterop": true, + "types": ["node"] + }, + "include": ["sample-imports.ts"] +} diff --git a/package.json b/package.json index 504f1cd58..98b5fd7e6 100644 --- a/package.json +++ b/package.json @@ -100,8 +100,9 @@ "puppeteer": "^22.8.2", "semver": "^7.6.0", "source-map-support": "^0.5.21", - "typedoc": "^0.25.12", - "typescript": "^5.4.2", + "typedoc": "^0.28.20", + "@typescript/native": "npm:typescript@^7.0.2", + "typescript": "npm:@typescript/typescript6@^6.0.2", "undici": "^8.2.0" }, "peerDependencies": { diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 5e1ff05f2..2bded024b 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.esm.json", "compilerOptions": { "module": "CommonJS", - "moduleResolution": "Node", + "moduleResolution": "Bundler", "outDir": "./build/cjs/" } } diff --git a/tsconfig.json b/tsconfig.json index b6e807959..5eccff85a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,7 @@ "strict": true, "strictFunctionTypes": true, "strictNullChecks": true, - "rootDir": "./src/" + "rootDir": "./src/", + "types": ["node", "mocha"] } } diff --git a/typedoc.json b/typedoc.json index 35dc46d23..8c9934e01 100644 --- a/typedoc.json +++ b/typedoc.json @@ -2,6 +2,7 @@ "basePath": "./src", "cacheBust": true, "disableGit": true, + "sourceLinkTemplate": "https://github.com/arangodb/arangojs/blob/main/src/{path}#L{line}", "disableSources": false, "entryPoints": ["src"], "entryPointStrategy": "expand", From 9be70cab00d5323959a77d12dbbd33a0613cdfb7 Mon Sep 17 00:00:00 2001 From: bluepal-yaswanth-peravali Date: Tue, 21 Jul 2026 11:13:54 +0530 Subject: [PATCH 2/5] DE-1179 | Updated driver to latest typescript 7 --- compat-test/package.json | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/compat-test/package.json b/compat-test/package.json index 07266f266..df377b266 100644 --- a/compat-test/package.json +++ b/compat-test/package.json @@ -2,12 +2,5 @@ "name": "arangojs-compat-test", "private": true, "type": "module", - "description": "Consumer compatibility smoke test for published arangojs types (see the compat-typescript workflow in .circleci/config.yml)", - "devDependencies": { - "@types/node": "^20.19.43", - "typescript": "^7.0.2" - }, - "dependencies": { - "arangojs": "file:../arangojs-pack.tgz" - } -} + "description": "Consumer compatibility smoke test for published arangojs types (see the compat-typescript workflow in .circleci/config.yml)" +} \ No newline at end of file From c7ad6319acb8b27a57c02484b6a1c6f567dba551 Mon Sep 17 00:00:00 2001 From: bluepal-yaswanth-peravali Date: Wed, 22 Jul 2026 16:24:34 +0530 Subject: [PATCH 3/5] fix: stabilize stream/cursor CI flakes and run single-topology on small runners --- .circleci/README.md | 9 +++---- .circleci/config.yml | 40 ++++++++++++++++++++++++++----- CHANGELOG.md | 4 ++++ src/test/08-cursors.ts | 3 ++- src/test/23-aql-queries-stream.ts | 40 ++++++++++++++++++++++--------- 5 files changed, 74 insertions(+), 22 deletions(-) diff --git a/.circleci/README.md b/.circleci/README.md index 7363e710b..ecb3214e7 100644 --- a/.circleci/README.md +++ b/.circleci/README.md @@ -25,7 +25,8 @@ All integration and browser jobs attach **`context: docker-hub`**. | Job | Executor | Resource class | | --- | -------- | -------------- | -| **`node-test`** | `n22` / `n24` | `arangodb/medium-arm64-privileged` | +| **`node-test`** (single / HTTP smoke) | `n22` / `n24` | `arangodb/small-arm64-privileged` | +| **`node-test`** (cluster) | `n22` / `n24` | `arangodb/medium-arm64-privileged` | | **`browser-smoke`** | `n24-browser` (`cimg/node:24.4`) | `arangodb/medium-amd64-privileged` | - **`setup-docker`** — install Docker CLI, start in-container `dockerd` (DinD). @@ -122,15 +123,15 @@ All run when **`docker-img`** is set (Trigger Pipeline). They use the same **`<< | ------------------- | ----------------------------------------------- | | **Docker DB image** | `<>` | | **Node** | `n22`, `n24` | -| **Topology** | `single`, `cluster` | +| **Topology** | `single` (small runners), `cluster` (medium) | | **SSL** | `true`, `false` | | **Module system** | `cjs`, `esm` | | **HTTP** | Default `**h1`** only (no `http_proto` matrix). | -**Job count:** 2 × 2 × 2 × 2 = **16**. +**Job count:** 2 × 2 × 2 × 2 = **16** (8 single + 8 cluster). -**Naming:** `--ssl-` +**Naming:** `-single-ssl-` | `-cluster-ssl-` ### B) `integration-http-proto-smoke-given-db-image` (**2** jobs) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7cbd0672f..190a48190 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,11 +96,9 @@ executors: n22: docker: - image: cimg/node:22.22.3 - resource_class: arangodb/medium-arm64-privileged n24: docker: - image: cimg/node:24.16.0 - resource_class: arangodb/medium-arm64-privileged n24-browser: docker: - image: cimg/node:24.16.0 @@ -128,7 +126,12 @@ jobs: module-system: type: enum enum: ['cjs', 'esm'] + # Single-server DinD fits small; cluster stays on medium. + resource_class: + type: string + default: 'arangodb/medium-arm64-privileged' executor: <> + resource_class: <> steps: - timeout - checkout @@ -271,6 +274,7 @@ workflows: name: single-<>-ssl<>-<>-312 context: docker-hub topology: single + resource_class: arangodb/small-arm64-privileged filters: branches: ignore: stable @@ -291,6 +295,7 @@ workflows: name: single-<>-ssl<>-<>-4.0-nightly context: docker-hub topology: single + resource_class: arangodb/small-arm64-privileged filters: branches: ignore: stable @@ -367,6 +372,7 @@ workflows: ignore: stable docker-img: 'gcr.io/gcr-for-testing/arangodb/enterprise:3.12' topology: single + resource_class: arangodb/small-arm64-privileged ssl: 'true' http_proto: h1 node: n24 @@ -379,6 +385,7 @@ workflows: ignore: stable docker-img: 'gcr.io/gcr-for-testing/arangodb/enterprise:3.12' topology: single + resource_class: arangodb/small-arm64-privileged ssl: 'true' http_proto: h2 node: n24 @@ -409,8 +416,30 @@ workflows: when: <> jobs: - node-test: - name: <>-<>-ssl<>-<> + name: <>-single-ssl<>-<> context: docker-hub + topology: single + resource_class: arangodb/small-arm64-privileged + filters: + branches: + ignore: stable + matrix: + parameters: + docker-img: + - <> + node: + - 'n22' + - 'n24' + ssl: + - 'true' + - 'false' + module-system: + - 'cjs' + - 'esm' + - node-test: + name: <>-cluster-ssl<>-<> + context: docker-hub + topology: cluster filters: branches: ignore: stable @@ -421,9 +450,6 @@ workflows: node: - 'n22' - 'n24' - topology: - - 'single' - - 'cluster' ssl: - 'true' - 'false' @@ -443,6 +469,7 @@ workflows: ignore: stable docker-img: <> topology: single + resource_class: arangodb/small-arm64-privileged ssl: 'true' http_proto: h1 node: n24 @@ -455,6 +482,7 @@ workflows: ignore: stable docker-img: <> topology: single + resource_class: arangodb/small-arm64-privileged ssl: 'true' http_proto: h2 node: n24 diff --git a/CHANGELOG.md b/CHANGELOG.md index 316e922ab..26121fb03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ This driver uses semantic versioning: on the default `globalThis.fetch` path (not only when using `config.agentOptions`) by removing manual `Content-Length` header handling by default and letting `fetch` set it from the request body. ([#855](https://github.com/arangodb/arangojs/issues/855)) +- Tests: Stream query setup inserts and parallel stream opens are chunked; multi-batch cursor + tests use a longer `ttl` to avoid intermittent CI timeouts / `cursor not found` under load. ### Added @@ -34,6 +36,8 @@ This driver uses semantic versioning: ### Changed +- CI: Single-topology and HTTP proto smoke `node-test` jobs use + `arangodb/small-arm64-privileged`; cluster jobs keep `arangodb/medium-arm64-privileged`. - Dev: Builds use **TypeScript 7** (`@typescript/native` → `typescript@^7.0.2`) for `tsc`. The `typescript` package is aliased to `@typescript/typescript6` so tools that still need the TypeScript 6 programmatic API (TypeDoc, typescript-eslint) keep working until a TS 7 API ships. diff --git a/src/test/08-cursors.ts b/src/test/08-cursors.ts index bd30bd0e6..97f940681 100644 --- a/src/test/08-cursors.ts +++ b/src/test/08-cursors.ts @@ -276,7 +276,8 @@ describe("Batch-wise Cursor API", function () { } }); beforeEach(async () => { - cursor = (await db.query(aqlQuery, { batchSize: 1 })).batches; + // batchSize:1 needs many round-trips; keep cursor alive under slow CI/cluster. + cursor = (await db.query(aqlQuery, { batchSize: 1, ttl: 120 })).batches; allCursors.push(cursor); }); describe("for await of cursor", () => { diff --git a/src/test/23-aql-queries-stream.ts b/src/test/23-aql-queries-stream.ts index 5b1ea7f4d..97e0d3bed 100644 --- a/src/test/23-aql-queries-stream.ts +++ b/src/test/23-aql-queries-stream.ts @@ -10,6 +10,23 @@ import { waitForNewDatabase, } from "./_integration-timeouts.js"; +/** Cap in-flight writes/streams so small CI runners and cluster LBs stay responsive. */ +const insertChunk = 100; +const streamOpenChunk = 5; +const docCount = 1000; +const parallelStreamCount = 25; + +async function parallelInChunks( + count: number, + chunk: number, + run: (index: number) => Promise, +): Promise { + for (let i = 0; i < count; i += chunk) { + const n = Math.min(chunk, count - i); + await Promise.all(Array.from({ length: n }, (_, j) => run(i + j))); + } +} + describe("AQL Stream queries", function () { this.timeout(clusterIntegrationTimeoutMs); const name = `testdb_${Date.now()}`; @@ -70,7 +87,9 @@ describe("AQL Stream queries", function () { expect(cursor.batches.hasMore).to.equal(true); }); }); - describe("with some data", () => { + describe("with some data", function () { + // Setup inserts many docs; keep headroom above the single-topology 60s suite ceiling. + this.timeout(Math.max(clusterIntegrationTimeoutMs, 120_000)); const cname = "MyTestCollection"; before(async () => { const collection = await db.createCollection(cname); @@ -78,10 +97,8 @@ describe("AQL Stream queries", function () { { pathname: `/_api/collection/${collection.name}` }, propagationForResourceMs, ); - await Promise.all( - Array.from(Array(1000).keys()).map((i: number) => - collection.save({ hallo: i }), - ), + await parallelInChunks(docCount, insertChunk, (i) => + collection.save({ hallo: i }), ); }); /*after(async () => { @@ -90,21 +107,22 @@ describe("AQL Stream queries", function () { it("can access large collection in parallel", async () => { const collection = db.collection(cname); const query = aql`FOR doc in ${collection} RETURN doc`; - const options = { batchSize: 250, stream: true }; + const options = { batchSize: 250, stream: true, ttl: 120 }; let count = 0; - const cursors = await Promise.all( - Array.from(Array(25)).map(() => db.query(query, options)), - ); + const cursors: Cursor[] = []; + await parallelInChunks(parallelStreamCount, streamOpenChunk, async () => { + cursors.push(await db.query(query, options)); + }); allCursors.push(...cursors); await Promise.all( cursors.map((c) => - (c as Cursor).forEach(() => { + c.forEach(() => { count++; }), ), ); - expect(count).to.equal(25 * 1000); + expect(count).to.equal(parallelStreamCount * docCount); }); it("can do writes and reads", async () => { const collection = db.collection(cname); From 7a498c7c6c66cfd0ef702bb851ee8022cf89811f Mon Sep 17 00:00:00 2001 From: bluepal-yaswanth-peravali Date: Fri, 11 Sep 2026 15:49:01 +0530 Subject: [PATCH 4/5] chore: revert changes made in tests --- CHANGELOG.md | 17 +++++++++++++ src/test/23-aql-queries-stream.ts | 40 +++++++++---------------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef88bf9e..fe17b1661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,23 @@ This driver uses semantic versioning: ## [Unreleased] +### Added + +- CI: CircleCI `compat-typescript` workflow builds/packs the driver once and typechecks the + publishable tarball as a TypeScript **5.4**, **6.0**, and **7.0** consumer (`compat-test/`). + +### Changed + +- CI: Single-topology and HTTP proto smoke `node-test` jobs use + `arangodb/small-arm64-privileged`; cluster jobs keep `arangodb/medium-arm64-privileged`. +- Dev: Builds use **TypeScript 7** (`@typescript/native` → `typescript@^7.0.2`) for `tsc`. The + `typescript` package is aliased to `@typescript/typescript6` so tools that still need the + TypeScript 6 programmatic API (TypeDoc, typescript-eslint) keep working until a TS 7 API ships. +- Dev: Set explicit `compilerOptions.types` (`node`, `mocha`) for TS 6/7’s stricter `@types` + handling. CJS build uses `moduleResolution: "Bundler"` with `module: "CommonJS"` (replaces + deprecated `node10` / `"Node"` resolution). +- Dev: Upgraded TypeDoc to **0.28.20** for TypeScript 6 peer compatibility (docs generation). + ## [10.5.0] - 2026-09-11 ### Added diff --git a/src/test/23-aql-queries-stream.ts b/src/test/23-aql-queries-stream.ts index 97e0d3bed..5b1ea7f4d 100644 --- a/src/test/23-aql-queries-stream.ts +++ b/src/test/23-aql-queries-stream.ts @@ -10,23 +10,6 @@ import { waitForNewDatabase, } from "./_integration-timeouts.js"; -/** Cap in-flight writes/streams so small CI runners and cluster LBs stay responsive. */ -const insertChunk = 100; -const streamOpenChunk = 5; -const docCount = 1000; -const parallelStreamCount = 25; - -async function parallelInChunks( - count: number, - chunk: number, - run: (index: number) => Promise, -): Promise { - for (let i = 0; i < count; i += chunk) { - const n = Math.min(chunk, count - i); - await Promise.all(Array.from({ length: n }, (_, j) => run(i + j))); - } -} - describe("AQL Stream queries", function () { this.timeout(clusterIntegrationTimeoutMs); const name = `testdb_${Date.now()}`; @@ -87,9 +70,7 @@ describe("AQL Stream queries", function () { expect(cursor.batches.hasMore).to.equal(true); }); }); - describe("with some data", function () { - // Setup inserts many docs; keep headroom above the single-topology 60s suite ceiling. - this.timeout(Math.max(clusterIntegrationTimeoutMs, 120_000)); + describe("with some data", () => { const cname = "MyTestCollection"; before(async () => { const collection = await db.createCollection(cname); @@ -97,8 +78,10 @@ describe("AQL Stream queries", function () { { pathname: `/_api/collection/${collection.name}` }, propagationForResourceMs, ); - await parallelInChunks(docCount, insertChunk, (i) => - collection.save({ hallo: i }), + await Promise.all( + Array.from(Array(1000).keys()).map((i: number) => + collection.save({ hallo: i }), + ), ); }); /*after(async () => { @@ -107,22 +90,21 @@ describe("AQL Stream queries", function () { it("can access large collection in parallel", async () => { const collection = db.collection(cname); const query = aql`FOR doc in ${collection} RETURN doc`; - const options = { batchSize: 250, stream: true, ttl: 120 }; + const options = { batchSize: 250, stream: true }; let count = 0; - const cursors: Cursor[] = []; - await parallelInChunks(parallelStreamCount, streamOpenChunk, async () => { - cursors.push(await db.query(query, options)); - }); + const cursors = await Promise.all( + Array.from(Array(25)).map(() => db.query(query, options)), + ); allCursors.push(...cursors); await Promise.all( cursors.map((c) => - c.forEach(() => { + (c as Cursor).forEach(() => { count++; }), ), ); - expect(count).to.equal(parallelStreamCount * docCount); + expect(count).to.equal(25 * 1000); }); it("can do writes and reads", async () => { const collection = db.collection(cname); From fa5390fd37ef678727b306de23b4a6f03d6b8d30 Mon Sep 17 00:00:00 2001 From: bluepal-yaswanth-peravali Date: Fri, 11 Sep 2026 15:51:45 +0530 Subject: [PATCH 5/5] chore: revert changes made in CHANGELOG --- CHANGELOG.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe17b1661..ae89ab49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,8 +57,6 @@ This driver uses semantic versioning: on the default `globalThis.fetch` path (not only when using `config.agentOptions`) by removing manual `Content-Length` header handling by default and letting `fetch` set it from the request body. ([#855](https://github.com/arangodb/arangojs/issues/855)) -- Tests: Stream query setup inserts and parallel stream opens are chunked; multi-batch cursor - tests use a longer `ttl` to avoid intermittent CI timeouts / `cursor not found` under load. - Fixed connection failures never being retried. `isSystemError` rejected the error objects thrown by undici because their immediate prototype is not `Error.prototype`, so a refused connection produced @@ -79,20 +77,6 @@ This driver uses semantic versioning: Next.js 15 production builds when using `next/headers` `cookies()` ([#831](https://github.com/arangodb/arangojs/issues/831)). Do not enable this when using undici 8.x unless required — it restores explicit `Content-Length` handling that can conflict with strict undici header validation. -- CI: CircleCI `compat-typescript` workflow builds/packs the driver once and typechecks the - publishable tarball as a TypeScript **5.4**, **6.0**, and **7.0** consumer (`compat-test/`). - -### Changed - -- CI: Single-topology and HTTP proto smoke `node-test` jobs use - `arangodb/small-arm64-privileged`; cluster jobs keep `arangodb/medium-arm64-privileged`. -- Dev: Builds use **TypeScript 7** (`@typescript/native` → `typescript@^7.0.2`) for `tsc`. The - `typescript` package is aliased to `@typescript/typescript6` so tools that still need the - TypeScript 6 programmatic API (TypeDoc, typescript-eslint) keep working until a TS 7 API ships. -- Dev: Set explicit `compilerOptions.types` (`node`, `mocha`) for TS 6/7’s stricter `@types` - handling. CJS build uses `moduleResolution: "Bundler"` with `module: "CommonJS"` (replaces - deprecated `node10` / `"Node"` resolution). -- Dev: Upgraded TypeDoc to **0.28.20** for TypeScript 6 peer compatibility (docs generation). ### Deprecated