Skip to content

Commit f44086c

Browse files
committed
refactor: wip
1 parent 1321cbe commit f44086c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/utils/src/lib/profiler/profiler-node.int.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,13 +436,11 @@ describe('NodeJS Profiler Integration', () => {
436436
}
437437

438438
const validationStartTime = performance.now();
439-
expect(coordinatorStats).toStrictEqual(
440-
expect.objectContaining({
441-
isCoordinator: true,
442-
shardFileCount: numProcesses + 1, // numProcesses child processes + 1 coordinator shard
443-
groupId: expect.stringMatching(/^\d{8}-\d{6}-\d{3}$/), // Auto-generated groupId format
444-
}),
445-
);
439+
expect(coordinatorStats).toMatchObject({
440+
isCoordinator: true,
441+
shardFileCount: numProcesses + 1, // numProcesses child processes + 1 coordinator shard
442+
groupId: expect.stringMatching(/^\d{8}-\d{6}-\d{3}$/), // Auto-generated groupId format
443+
});
446444

447445
// Verify all processes share the same groupId
448446
const groupId = coordinatorStats.groupId;

packages/utils/src/lib/wal-sharded.unit.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { vol } from 'memfs';
22
import { beforeEach, describe, expect, it } from 'vitest';
3-
import { MEMFS_VOLUME } from '@code-pushup/test-utils';
3+
import { MEMFS_VOLUME, osAgnosticPath } from '@code-pushup/test-utils';
44
import { getUniqueInstanceId } from './process-id.js';
55
import { PROFILER_SHARDER_ID_ENV_VAR } from './profiler/constants.js';
66
import { ShardedWal } from './wal-sharded.js';
@@ -46,7 +46,8 @@ describe('ShardedWal', () => {
4646
expect(shard).toBeInstanceOf(WriteAheadLogFile);
4747
// Shard files use getShardId() format (timestamp.pid.threadId.counter)
4848
// The groupId is auto-generated and used in the shard path
49-
expect(shard.getPath()).toMatch(
49+
// Normalize path before regex matching to handle OS-specific separators
50+
expect(osAgnosticPath(shard.getPath())).toMatch(
5051
/^\/test\/shards\/\d{8}-\d{6}-\d{3}\/trace\.\d{8}-\d{6}-\d{3}(?:\.\d+){3}\.log$/,
5152
);
5253
expect(shard.getPath()).toEndWithPath('.log');

0 commit comments

Comments
 (0)