Skip to content

Commit 7bbd95b

Browse files
committed
Attempt b2c-cli fix
1 parent 5917bb6 commit 7bbd95b

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

packages/b2c-cli/test/functional/e2e/webdav-operations.test.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,29 @@ describe('WebDAV Operations E2E Tests', function () {
368368

369369
describe('Step 11: Verify Extracted Files', function () {
370370
it('should find extracted files in directory', async function () {
371-
await waitFor(async () => {
372-
const result = await runCLI([
371+
// Unzip visibility can be delayed on WebDAV; use longer timeout and poll every 1s
372+
try {
373+
await waitFor(
374+
async () => {
375+
const result = await runCLI([
376+
'webdav',
377+
'ls',
378+
remoteDirPath,
379+
'--server',
380+
serverHostname,
381+
'--root',
382+
'impex',
383+
'--json',
384+
]);
385+
if (result.exitCode !== 0) return false;
386+
const response = JSON.parse(toString(result.stdout));
387+
return response.entries?.some((e: any) => entryName(e) === testFileName);
388+
},
389+
420_000,
390+
1000,
391+
);
392+
} catch (error) {
393+
const diag = await runCLI([
373394
'webdav',
374395
'ls',
375396
remoteDirPath,
@@ -378,11 +399,10 @@ describe('WebDAV Operations E2E Tests', function () {
378399
'--root',
379400
'impex',
380401
'--json',
381-
]);
382-
if (result.exitCode !== 0) return false;
383-
const response = JSON.parse(toString(result.stdout));
384-
return response.entries?.some((e: any) => entryName(e) === testFileName);
385-
}, 300_000);
402+
]).then((r) => (r.exitCode === 0 ? toString(r.stdout) : `exit ${r.exitCode}: ${toString(r.stderr)}`));
403+
const msg = error instanceof Error ? error.message : String(error);
404+
throw new Error(`${msg}. Last LIST of ${remoteDirPath}: ${diag.slice(0, 500)}`);
405+
}
386406
});
387407
});
388408
});

0 commit comments

Comments
 (0)