Skip to content

Commit dd6e35e

Browse files
authored
refactor: simplify trace types and helper (#1236)
1 parent 5c3b286 commit dd6e35e

21 files changed

+1124
-930
lines changed

packages/utils/eslint.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ export default tseslint.config(
1818
'n/no-sync': 'off',
1919
},
2020
},
21+
{
22+
files: ['packages/utils/src/lib/profiler/trace-file-utils.ts'],
23+
rules: {
24+
// os.availableParallelism() is checked for existence before use, with fallback to os.cpus().length
25+
'n/no-unsupported-features/node-builtins': 'off',
26+
},
27+
},
2128
{
2229
files: ['**/*.json'],
2330
rules: {
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import process from 'node:process';
2+
import { threadId } from 'node:worker_threads';
3+
4+
/**
5+
* Counter interface for generating sequential instance IDs.
6+
* Encapsulates increment logic within the counter-implementation.
7+
*/
8+
export type Counter = {
9+
/**
10+
* Returns the next counter-value and increments the internal state.
11+
* @returns The next counter-value
12+
*/
13+
next: () => number;
14+
};
15+
16+
/**
17+
* Base regex pattern for time ID format: yyyymmdd-hhmmss-ms
18+
*/
19+
export const TIME_ID_BASE = /\d{8}-\d{6}-\d{3}/;
20+
21+
/**
22+
* Regex patterns for validating process and instance ID formats.
23+
* All patterns use strict anchors (^ and $) to ensure complete matches.
24+
*/
25+
export const ID_PATTERNS = Object.freeze({
26+
/**
27+
* Time ID / Run ID format: yyyymmdd-hhmmss-ms
28+
* Example: "20240101-120000-000"
29+
* Used by: getUniqueTimeId()
30+
*/
31+
TIME_ID: new RegExp(`^${TIME_ID_BASE.source}$`),
32+
/**
33+
* Group ID format: alias by convention, semantically represents a group of instances
34+
* Example: "20240101-120000-000"
35+
* Used by: grouping related instances by time
36+
*/
37+
GROUP_ID: new RegExp(`^${TIME_ID_BASE.source}$`),
38+
/**
39+
* Process/Thread ID format: timeId-pid-threadId
40+
* Example: "20240101-120000-000-12345-1"
41+
* Used by: getUniqueProcessThreadId()
42+
*/
43+
PROCESS_THREAD_ID: new RegExp(`^${TIME_ID_BASE.source}-\\d+-\\d+$`),
44+
/**
45+
* Instance ID format: timeId.pid.threadId.counter
46+
* Example: "20240101-120000-000.12345.1.1"
47+
* Used by: getUniqueInstanceId()
48+
*/
49+
INSTANCE_ID: new RegExp(`^${TIME_ID_BASE.source}\\.\\d+\\.\\d+\\.\\d+$`),
50+
} as const);
51+
52+
/**
53+
* Generates a unique run ID.
54+
* This ID uniquely identifies a run/execution with a globally unique, sortable, human-readable date string.
55+
* Format: yyyymmdd-hhmmss-ms
56+
* Example: "20240101-120000-000"
57+
*
58+
* @returns A unique run ID string in readable date format
59+
*/
60+
export function getUniqueTimeId(): string {
61+
return sortableReadableDateString(
62+
Math.floor(performance.timeOrigin + performance.now()),
63+
);
64+
}
65+
66+
/**
67+
* Generates a unique process/thread ID.
68+
* This ID uniquely identifies a process/thread execution and prevents race conditions when running
69+
* the same plugin for multiple projects in parallel.
70+
* Format: timeId-pid-threadId
71+
* Example: "20240101-120000-000-12345-1"
72+
*
73+
* @returns A unique ID string combining timestamp, process ID, and thread ID
74+
*/
75+
export function getUniqueProcessThreadId(): string {
76+
return `${getUniqueTimeId()}-${process.pid}-${threadId}`;
77+
}
78+
79+
/**
80+
* Generates a unique instance ID based on performance time origin, process ID, thread ID, and instance count.
81+
* This ID uniquely identifies an instance across processes and threads.
82+
* Format: timestamp.pid.threadId.counter
83+
* Example: "20240101-120000-000.12345.1.1"
84+
*
85+
* @param counter - Counter that provides the next instance count value
86+
* @returns A unique ID string combining timestamp, process ID, thread ID, and counter
87+
*/
88+
export function getUniqueInstanceId(counter: Counter): string {
89+
return `${getUniqueTimeId()}.${process.pid}.${threadId}.${counter.next()}`;
90+
}
91+
92+
/**
93+
* Converts a timestamp in milliseconds to a sortable, human-readable date string.
94+
* Format: yyyymmdd-hhmmss-ms
95+
* Example: "20240101-120000-000"
96+
*
97+
* @param timestampMs - Timestamp in milliseconds
98+
* @returns A sortable date string in yyyymmdd-hhmmss-ms format
99+
*/
100+
export function sortableReadableDateString(timestampMs: number): string {
101+
const date = new Date(timestampMs);
102+
const MILLISECONDS_PER_SECOND = 1000;
103+
const yyyy = date.getFullYear();
104+
const mm = String(date.getMonth() + 1).padStart(2, '0');
105+
const dd = String(date.getDate()).padStart(2, '0');
106+
const hh = String(date.getHours()).padStart(2, '0');
107+
const min = String(date.getMinutes()).padStart(2, '0');
108+
const ss = String(date.getSeconds()).padStart(2, '0');
109+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
110+
const ms = String(timestampMs % MILLISECONDS_PER_SECOND).padStart(3, '0');
111+
112+
return `${yyyy}${mm}${dd}-${hh}${min}${ss}-${ms}`;
113+
}
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
import { threadId } from 'node:worker_threads';
2+
import {
3+
type Counter,
4+
ID_PATTERNS,
5+
TIME_ID_BASE,
6+
getUniqueInstanceId,
7+
getUniqueProcessThreadId,
8+
getUniqueTimeId,
9+
sortableReadableDateString,
10+
} from './process-id.js';
11+
12+
describe('TIME_ID_BASE', () => {
13+
it.each([
14+
'20231114-221320-000',
15+
'20240101-120000-000',
16+
'20231231-235959-999',
17+
])('should match valid time ID format: %s', timeId => {
18+
expect(timeId).toMatch(TIME_ID_BASE);
19+
});
20+
21+
it.each(['2023-11-14', '20231114', '20231114-221320', 'invalid'])(
22+
'should not match invalid time ID format: %s',
23+
timeId => {
24+
expect(timeId).not.toMatch(TIME_ID_BASE);
25+
},
26+
);
27+
});
28+
29+
describe('ID_PATTERNS', () => {
30+
it.each(['20231114-221320-000', '20240101-120000-000'])(
31+
'TIME_ID should match valid time ID: %s',
32+
timeId => {
33+
expect(timeId).toMatch(ID_PATTERNS.TIME_ID);
34+
},
35+
);
36+
37+
it.each(['20231114-221320-000.123', '20231114-221320'])(
38+
'TIME_ID should not match invalid format: %s',
39+
timeId => {
40+
expect(timeId).not.toMatch(ID_PATTERNS.TIME_ID);
41+
},
42+
);
43+
44+
it('GROUP_ID should match valid group ID', () => {
45+
const groupId = '20231114-221320-000';
46+
expect(groupId).toMatch(ID_PATTERNS.GROUP_ID);
47+
});
48+
49+
it.each(['20231114-221320-000-12345-1', '20240101-120000-000-99999-99'])(
50+
'PROCESS_THREAD_ID should match valid process/thread ID: %s',
51+
processThreadId => {
52+
expect(processThreadId).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
53+
},
54+
);
55+
56+
it.each(['20231114-221320-000', '20231114-221320-000-12345'])(
57+
'PROCESS_THREAD_ID should not match invalid format: %s',
58+
processThreadId => {
59+
expect(processThreadId).not.toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
60+
},
61+
);
62+
63+
it.each(['20231114-221320-000.12345.1.1', '20240101-120000-000.99999.99.42'])(
64+
'INSTANCE_ID should match valid instance ID: %s',
65+
instanceId => {
66+
expect(instanceId).toMatch(ID_PATTERNS.INSTANCE_ID);
67+
},
68+
);
69+
70+
it.each(['20231114-221320-000', '20231114-221320-000-12345-1'])(
71+
'INSTANCE_ID should not match invalid format: %s',
72+
instanceId => {
73+
expect(instanceId).not.toMatch(ID_PATTERNS.INSTANCE_ID);
74+
},
75+
);
76+
});
77+
78+
describe('sortableReadableDateString', () => {
79+
it('should format timestamp correctly', () => {
80+
const timestamp = 1_700_000_000_000; // 2023-11-14 22:13:20.000
81+
const result = sortableReadableDateString(timestamp);
82+
expect(result).toBe('20231114-221320-000');
83+
expect(result).toMatch(TIME_ID_BASE);
84+
});
85+
});
86+
87+
describe('getUniqueTimeId', () => {
88+
it('should generate time ID with mocked timeOrigin', () => {
89+
const result = getUniqueTimeId();
90+
91+
expect(result).toMatch(ID_PATTERNS.TIME_ID);
92+
expect(result).toMatch(ID_PATTERNS.GROUP_ID);
93+
expect(result).toBe('20231114-221320-000');
94+
});
95+
96+
it('should generate new ID on each call (not idempotent)', () => {
97+
let callCount = 0;
98+
vi.spyOn(performance, 'now').mockImplementation(() => callCount++);
99+
100+
const id1 = getUniqueTimeId();
101+
const id2 = getUniqueTimeId();
102+
103+
expect(id1).not.toBe(id2);
104+
expect(id1).toMatch(ID_PATTERNS.TIME_ID);
105+
expect(id2).toMatch(ID_PATTERNS.TIME_ID);
106+
});
107+
});
108+
109+
describe('getUniqueProcessThreadId', () => {
110+
it('should generate process/thread ID with correct format', () => {
111+
const result = getUniqueProcessThreadId();
112+
113+
expect(result).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
114+
expect(result).toContain(`-10001-${threadId}`);
115+
expect(result).toStartWith('20231114-221320-000');
116+
});
117+
118+
it('should generate new ID on each call (not idempotent)', () => {
119+
let callCount = 0;
120+
vi.spyOn(performance, 'now').mockImplementation(() => callCount++);
121+
122+
const id1 = getUniqueProcessThreadId();
123+
const id2 = getUniqueProcessThreadId();
124+
125+
expect(id1).not.toBe(id2);
126+
expect(id1).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
127+
expect(id2).toMatch(ID_PATTERNS.PROCESS_THREAD_ID);
128+
});
129+
});
130+
131+
describe('getUniqueInstanceId', () => {
132+
it('should generate instance ID with correct format', () => {
133+
let counter = 0;
134+
const counterObj: Counter = {
135+
next: () => ++counter,
136+
};
137+
138+
const result = getUniqueInstanceId(counterObj);
139+
140+
expect(result).toMatch(ID_PATTERNS.INSTANCE_ID);
141+
expect(result).toStartWith('20231114-221320-000.');
142+
expect(result).toContain(`.10001.${threadId}.`);
143+
expect(result).toEndWith('.1');
144+
});
145+
146+
it('should use counter to generate incrementing instance IDs', () => {
147+
let counter = 0;
148+
const counterObj: Counter = {
149+
next: () => ++counter,
150+
};
151+
152+
const results = [
153+
getUniqueInstanceId(counterObj),
154+
getUniqueInstanceId(counterObj),
155+
getUniqueInstanceId(counterObj),
156+
];
157+
158+
expect(results[0]).toEndWith('.1');
159+
expect(results[1]).toEndWith('.2');
160+
expect(results[2]).toEndWith('.3');
161+
});
162+
163+
it('should generate different IDs for different calls', () => {
164+
let counter = 0;
165+
const counterObj: Counter = {
166+
next: () => ++counter,
167+
};
168+
169+
expect(getUniqueInstanceId(counterObj)).not.toBe(
170+
getUniqueInstanceId(counterObj),
171+
);
172+
});
173+
});
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-1:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"stats-profiler:operation-1","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"stats-profiler:operation-1","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-1:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
5-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-2:start","pid":10001,"tid":1,"ts":1700000005000004,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
6-
{"cat":"blink.user_timing","ph":"b","name":"stats-profiler:operation-2","id2":{"local":"0x2"},"pid":10001,"tid":1,"ts":1700000005000005,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
7-
{"cat":"blink.user_timing","ph":"e","name":"stats-profiler:operation-2","id2":{"local":"0x2"},"pid":10001,"tid":1,"ts":1700000005000006,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
8-
{"cat":"blink.user_timing","ph":"i","name":"stats-profiler:operation-2:end","pid":10001,"tid":1,"ts":1700000005000007,"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"stats-profiler:operation-1:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"stats-profiler:operation-1","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"stats-profiler:operation-1","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"stats-profiler:operation-1:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
5+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000004,"name":"stats-profiler:operation-2:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
6+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000005,"name":"stats-profiler:operation-2","ph":"b","id2":{"local":"0x2"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
7+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000006,"name":"stats-profiler:operation-2","ph":"e","id2":{"local":"0x2"},"args":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}
8+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000007,"name":"stats-profiler:operation-2:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Stats\",\"dataType\":\"track-entry\"}}"}}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"api-server:user-lookup:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"api-server:user-lookup","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"api-server:user-lookup","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"api-server:user-lookup:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"api-server:user-lookup:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"api-server:user-lookup","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"api-server:user-lookup","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"api-server:user-lookup:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"cache\",\"dataType\":\"track-entry\"}}"}}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"cat":"blink.user_timing","ph":"i","name":"write-test:test-operation:start","pid":10001,"tid":1,"ts":1700000005000000,"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
2-
{"cat":"blink.user_timing","ph":"b","name":"write-test:test-operation","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000001,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
3-
{"cat":"blink.user_timing","ph":"e","name":"write-test:test-operation","id2":{"local":"0x1"},"pid":10001,"tid":1,"ts":1700000005000002,"args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
4-
{"cat":"blink.user_timing","ph":"i","name":"write-test:test-operation:end","pid":10001,"tid":1,"ts":1700000005000003,"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
1+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000000,"name":"write-test:test-operation:start","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}
2+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000001,"name":"write-test:test-operation","ph":"b","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
3+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000002,"name":"write-test:test-operation","ph":"e","id2":{"local":"0x1"},"args":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}
4+
{"cat":"blink.user_timing","pid":10001,"tid":1,"ts":1700000005000003,"name":"write-test:test-operation:end","ph":"I","args":{"data":{"detail":"{\"devtools\":{\"track\":\"Test\",\"dataType\":\"track-entry\"}}"}}}

packages/utils/src/lib/profiler/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ export const PROFILER_DEBUG_ENV_VAR = 'CP_PROFILER_DEBUG';
2525
*/
2626
export const SHARDED_WAL_COORDINATOR_ID_ENV_VAR =
2727
'CP_SHARDED_WAL_COORDINATOR_ID';
28+
29+
/**
30+
* Default base name for WAL files.
31+
* Used as the base name for sharded WAL files (e.g., "trace" in "trace.json").
32+
*/
33+
export const PROFILER_PERSIST_BASENAME = 'trace';

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import {
55
omitTraceJson,
66
} from '@code-pushup/test-utils';
77
import type { PerformanceEntryEncoder } from '../performance-observer.js';
8-
import { WAL_ID_PATTERNS } from '../wal.js';
8+
import { ID_PATTERNS } from '../process-id.js';
99
import { NodejsProfiler } from './profiler-node.js';
1010
import { entryToTraceEvents } from './trace-file-utils.js';
11-
import type { UserTimingTraceEvent } from './trace-file.type.js';
11+
import type { TraceEvent } from './trace-file.type.js';
1212

1313
describe('NodeJS Profiler Integration', () => {
14-
const traceEventEncoder: PerformanceEntryEncoder<UserTimingTraceEvent> =
14+
const traceEventEncoder: PerformanceEntryEncoder<TraceEvent> =
1515
entryToTraceEvents;
1616

17-
let nodejsProfiler: NodejsProfiler<UserTimingTraceEvent>;
17+
let nodejsProfiler: NodejsProfiler<TraceEvent>;
1818

1919
beforeEach(() => {
2020
performance.clearMarks();
@@ -261,7 +261,7 @@ describe('NodeJS Profiler Integration', () => {
261261
const groupIdDir = pathParts.at(-2);
262262
const fileName = pathParts.at(-1);
263263

264-
expect(groupIdDir).toMatch(WAL_ID_PATTERNS.GROUP_ID);
264+
expect(groupIdDir).toMatch(ID_PATTERNS.TIME_ID);
265265
expect(fileName).toMatch(/^trace\.\d{8}-\d{6}-\d{3}(?:\.\d+){3}\.jsonl$/);
266266

267267
const groupIdDirPath = path.dirname(filePath);
@@ -283,7 +283,7 @@ describe('NodeJS Profiler Integration', () => {
283283
const dirPath = path.dirname(filePath);
284284
const groupId = path.basename(dirPath);
285285

286-
expect(groupId).toMatch(WAL_ID_PATTERNS.GROUP_ID);
286+
expect(groupId).toMatch(ID_PATTERNS.TIME_ID);
287287
// eslint-disable-next-line n/no-sync
288288
expect(fs.existsSync(dirPath)).toBeTrue();
289289
// eslint-disable-next-line n/no-sync

0 commit comments

Comments
 (0)