Skip to content

Commit 1c38258

Browse files
committed
fix tests
1 parent d6a4a3d commit 1c38258

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Server Configuration
66
# ============================================================================
77

8-
# Port for HTTP/HTTPS server (default: 3001)
9-
PORT=3001
8+
# Port for HTTP/HTTPS server (default: 3000)
9+
PORT=3000
1010

1111
# Host to bind to (default: 0.0.0.0 for all interfaces)
1212
HOST=0.0.0.0

tests/tools/lm_device_group.test.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
extractToolData,
1010
generateTestResourceName,
1111
isValidLMId,
12+
retry,
1213
waitForIndexing,
1314
} from '../utils/testHelpers.js';
1415
import {
@@ -253,12 +254,28 @@ describe('lm_device_group', () => {
253254
});
254255
createdGroupIds.push(group1.id, group2.id);
255256

256-
// Wait for groups to be indexed before filtering
257-
await waitForIndexing();
257+
// Exact names + OR avoids wildcard quirks; poll until list matches (LM search can lag create).
258+
const batchFilter = `name:"${prefix}-1"||name:"${prefix}-2"`;
259+
await retry(
260+
async () => {
261+
const check = await client.callTool('lm_device_group', {
262+
operation: 'list',
263+
filter: batchFilter,
264+
size: 50,
265+
autoPaginate: false,
266+
});
267+
assertToolSuccess(check);
268+
const checkData = extractToolData<{ items: Array<{ id: number }> }>(check);
269+
if ((checkData.items?.length ?? 0) < 2) {
270+
throw new Error('device groups not yet visible to list/filter');
271+
}
272+
},
273+
{ maxAttempts: 15, delayMs: 2000 }
274+
);
258275

259276
const result = await client.callTool('lm_device_group', {
260277
operation: 'update',
261-
filter: `name:"${prefix}*"`,
278+
filter: batchFilter,
262279
updates: {
263280
description: 'Batch updated',
264281
},

0 commit comments

Comments
 (0)