From 5c225a8cf9f23b712c14b94baaef39df1a4c707a Mon Sep 17 00:00:00 2001 From: dholms Date: Wed, 8 Nov 2023 13:11:36 -0600 Subject: [PATCH] fix transfer test --- packages/pds/tests/transfer-repo.test.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/pds/tests/transfer-repo.test.ts b/packages/pds/tests/transfer-repo.test.ts index 6498c33ec26..f2e6dca0bfd 100644 --- a/packages/pds/tests/transfer-repo.test.ts +++ b/packages/pds/tests/transfer-repo.test.ts @@ -93,15 +93,23 @@ describe('transfer repo', () => { const signingKey = signingKeyRes.data.signingKey const repo = await entrywayAgent.api.com.atproto.sync.getRepo({ did }) - await axios.post(`${pds.url}/xrpc/com.atproto.temp.importRepo`, repo.data, { - params: { did }, - headers: { - 'content-type': 'application/vnd.ipld.car', - ...pds.adminAuthHeaders('admin'), + const importRes = await axios.post( + `${pds.url}/xrpc/com.atproto.temp.importRepo`, + repo.data, + { + params: { did }, + headers: { + 'content-type': 'application/vnd.ipld.car', + ...pds.adminAuthHeaders('admin'), + }, + decompress: true, + responseType: 'stream', }, - decompress: true, - responseType: 'stream', - }) + ) + + for await (const _log of importRes.data) { + // noop just wait till import is finished + } const lastOp = await pds.ctx.plcClient.getLastOp(did) if (!lastOp || lastOp.type === 'plc_tombstone') {