From 00a0381ba2e2fda29ceb2b4730d5e17aaa2c5893 Mon Sep 17 00:00:00 2001 From: munna0908 Date: Wed, 2 Jul 2025 19:55:19 +0530 Subject: [PATCH] adding log stmts --- codex/erasure/erasure.nim | 5 +---- tests/codex/testerasure.nim | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/codex/erasure/erasure.nim b/codex/erasure/erasure.nim index da41c4a0..dabe3b4d 100644 --- a/codex/erasure/erasure.nim +++ b/codex/erasure/erasure.nim @@ -319,12 +319,11 @@ proc asyncEncode*( self: ErasureRef, blockSize, parityLen: int, blocks: seq[seq[byte]] ): Future[?!seq[seq[byte]]] {.async: (raises: [CancelledError]).} = var threadPtr = ?ThreadSignalPtr.new().mapFailure() - echo "In Async Encode" + defer: if threadPtr != nil: ?threadPtr.close().mapFailure() threadPtr = nil - echo "Out Async Encode" ## Create an ecode task with block data var task = EncodeTask( @@ -484,12 +483,10 @@ proc asyncDecode*( ): Future[?!seq[seq[byte]]] {.async: (raises: [CancelledError]).} = var threadPtr = ?ThreadSignalPtr.new().mapFailure() - echo "In Async Decode" defer: if threadPtr != nil: ?threadPtr.close().mapFailure() threadPtr = nil - echo "Out Async Decode" ## Create an decode task with block data var task = DecodeTask( diff --git a/tests/codex/testerasure.nim b/tests/codex/testerasure.nim index 8760da08..0e91dbb5 100644 --- a/tests/codex/testerasure.nim +++ b/tests/codex/testerasure.nim @@ -179,6 +179,7 @@ suite "Erasure encode/decode": decoded = (await erasure.decode(encoded)).tryGet() test "Should tolerate losing M (a.k.a row) contiguous data blocks": + echo "Testing tolerance for losing M contiguous data blocks" const buffers = 20 parity = 10 @@ -197,6 +198,7 @@ suite "Erasure encode/decode": check present.tryGet() test "Should tolerate losing M (a.k.a row) contiguous parity blocks": + echo "Testing tolerance for losing M contiguous parity blocks" const buffers = 20 parity = 10 @@ -219,6 +221,7 @@ suite "Erasure encode/decode": check present.tryGet() test "Handles edge case of 0 parity blocks": + echo "Testing edge case of 0 parity blocks" const buffers = 20 parity = 0 @@ -228,6 +231,7 @@ suite "Erasure encode/decode": discard (await erasure.decode(encoded)).tryGet() test "Should concurrently encode/decode multiple datasets": + echo "Testing concurrent encode/decode with multiple datasets" const iterations = 5 let @@ -265,6 +269,7 @@ suite "Erasure encode/decode": decoded.blocksCount == encoded.originalBlocksCount test "Should handle verifiable manifests": + echo "Testing verifiable manifests" const buffers = 20 parity = 10