@@ -141,7 +141,9 @@ describe('load', () => {
141
141
wallet = await getWallet ( ) ;
142
142
( { address } = ( await firstValueFrom ( wallet . addresses$ ) ) [ 0 ] ) ;
143
143
144
+ logger . debug ( 'Waiting to settle wallet status' ) ;
144
145
await firstValueFrom ( wallet . syncStatus . isSettled$ . pipe ( filter ( ( isSettled ) => isSettled ) ) ) ;
146
+ logger . debug ( 'Wallet status settled' ) ;
145
147
} ;
146
148
147
149
const waitForTxInBlockchain = ( txId : Cardano . TransactionId ) =>
@@ -164,9 +166,9 @@ describe('load', () => {
164
166
} ) ;
165
167
166
168
logger . info ( `Fragmentation tx: ${ tx . hash } ` ) ;
167
-
168
169
await wallet . submitTx ( await wallet . finalizeTx ( tx ) ) ;
169
170
await waitForTxInBlockchain ( tx . hash ) ;
171
+ logger . info ( 'Fragmentation completed' ) ;
170
172
} ;
171
173
172
174
if ( options . directlyToOgmios ) await fragment ( ) ;
@@ -220,50 +222,61 @@ describe('load', () => {
220
222
afterEach ( stopWorker ) ;
221
223
222
224
const performTest = async ( options : TestOptions ) => {
223
- const { directlyToOgmios, withRunningWorker } = options ;
225
+ const { directlyToOgmios, parallel , withRunningWorker } = options ;
224
226
const submitPromises : Promise < void > [ ] = [ ] ;
225
227
const txIds : Cardano . TransactionId [ ] = [ ] ;
226
228
let timeAfterWorkerStarted = 0 ;
227
229
let timeBeforeSubmitTxs = 0 ;
228
230
229
- await fragmentWhenRequired ( options ) ;
231
+ try {
232
+ logger . debug ( `Starting test with options: ${ JSON . stringify ( { directlyToOgmios, parallel, withRunningWorker } ) } ` ) ;
230
233
231
- const startWorkerForTest = async ( ) => {
232
- if ( ! directlyToOgmios ) await startWorker ( options ) ;
233
- timeAfterWorkerStarted = Date . now ( ) ;
234
- } ;
234
+ await fragmentWhenRequired ( options ) ;
235
235
236
- const submitTransactions = async ( ) => {
237
- timeBeforeSubmitTxs = Date . now ( ) ;
238
- for ( let i = 0 ; i < env . TRANSACTIONS_NUMBER ; ++ i ) {
239
- const coins = 1_000_000n + 1000n * BigInt ( i ) ;
240
- const tx = await wallet . initializeTx ( { outputs : new Set ( [ { address, value : { coins } } ] ) } ) ;
236
+ const startWorkerForTest = async ( ) => {
237
+ if ( ! directlyToOgmios ) await startWorker ( options ) ;
238
+ timeAfterWorkerStarted = Date . now ( ) ;
239
+ } ;
241
240
242
- submitPromises . push ( wallet . submitTx ( await wallet . finalizeTx ( tx ) ) ) ;
243
- txIds . push ( tx . hash ) ;
241
+ const submitTransactions = async ( ) => {
242
+ timeBeforeSubmitTxs = Date . now ( ) ;
243
+ for ( let i = 0 ; i < env . TRANSACTIONS_NUMBER ; ++ i ) {
244
+ const coins = 1_000_000n + 1000n * BigInt ( i ) ;
245
+ const tx = await wallet . initializeTx ( { outputs : new Set ( [ { address, value : { coins } } ] ) } ) ;
246
+
247
+ submitPromises . push ( wallet . submitTx ( await wallet . finalizeTx ( tx ) ) ) ;
248
+ txIds . push ( tx . hash ) ;
249
+ }
250
+ } ;
251
+
252
+ if ( withRunningWorker ) {
253
+ await startWorkerForTest ( ) ;
254
+ await submitTransactions ( ) ;
255
+ } else {
256
+ await submitTransactions ( ) ;
257
+ await startWorkerForTest ( ) ;
244
258
}
245
- } ;
246
259
247
- if ( withRunningWorker ) {
248
- await startWorkerForTest ( ) ;
249
- await submitTransactions ( ) ;
250
- } else {
251
- await submitTransactions ( ) ;
252
- await startWorkerForTest ( ) ;
253
- }
260
+ await Promise . all ( submitPromises ) ;
261
+ const timeAfterTxsInMempool = Date . now ( ) ;
254
262
255
- await Promise . all ( submitPromises ) ;
256
- const timeAfterTxsInMempool = Date . now ( ) ;
263
+ await Promise . all ( txIds . map ( ( txId ) => waitForTxInBlockchain ( txId ) ) ) ;
257
264
258
- await Promise . all ( txIds . map ( ( txId ) => waitForTxInBlockchain ( txId ) ) ) ;
265
+ testReports . push ( {
266
+ ...options ,
267
+ timeAfterTxsInBlockchain : Date . now ( ) ,
268
+ timeAfterTxsInMempool,
269
+ timeAfterWorkerStarted,
270
+ timeBeforeSubmitTxs
271
+ } ) ;
259
272
260
- testReports . push ( {
261
- ... options ,
262
- timeAfterTxsInBlockchain : Date . now ( ) ,
263
- timeAfterTxsInMempool ,
264
- timeAfterWorkerStarted ,
265
- timeBeforeSubmitTxs
266
- } ) ;
273
+ logger . debug ( `Completed test with options: ${ JSON . stringify ( { directlyToOgmios , parallel , withRunningWorker } ) } ` ) ;
274
+ } catch ( error ) {
275
+ logger . error (
276
+ `Failed test with options: ${ JSON . stringify ( { directlyToOgmios , parallel , withRunningWorker } ) } ` ,
277
+ error
278
+ ) ;
279
+ }
267
280
} ;
268
281
269
282
describe ( 'directly to ogmios' , ( ) => {
0 commit comments