Skip to content

Commit 18e94bd

Browse files
committed
fix(test): regenerate category name per attempt in post-crud e2e
categoryName was set in beforeAll, so vitest retries reused the same name and hit categories_name_uniq on every retry — masking the underlying line-94 parseEnvelope flake as a hard category-create 500. Move name + slug into the it() body so retries get a fresh name and can actually recover.
1 parent a3ad894 commit 18e94bd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/e2e/test/post-crud.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { makeTmpHome, type TmpHome } from '../src/helpers/tmp-home'
1414
describe('mxs post CRUD against real core', () => {
1515
let backend: E2EBackend
1616
let tmpHome: TmpHome
17-
let categoryName: string
1817

1918
beforeAll(async () => {
2019
backend = await createE2EBackend()
@@ -23,7 +22,6 @@ describe('mxs post CRUD against real core', () => {
2322
profile: 'post-crud',
2423
tmpHome: tmpHome.path,
2524
})
26-
categoryName = `E2E ${Date.now()}`
2725
}, 90_000)
2826

2927
afterAll(async () => {
@@ -34,6 +32,8 @@ describe('mxs post CRUD against real core', () => {
3432
const env = () => backend.backendEnv(tmpHome.path)
3533

3634
it('creates, lists, gets, updates, and deletes a post', async () => {
35+
const unique = `${Date.now()}-${Math.floor(Math.random() * 1e6)}`
36+
const categoryName = `E2E ${unique}`
3737
const category = await runMxs(
3838
[
3939
'--json',
@@ -42,7 +42,7 @@ describe('mxs post CRUD against real core', () => {
4242
'--name',
4343
categoryName,
4444
'--slug',
45-
`e2e-${Date.now()}`,
45+
`e2e-${unique}`,
4646
],
4747
env(),
4848
)

0 commit comments

Comments
 (0)