adding log stmts

This commit is contained in:
munna0908 2025-07-02 19:55:19 +05:30
parent 48600dd398
commit 00a0381ba2
No known key found for this signature in database
GPG Key ID: 2FFCD637E937D3E6
2 changed files with 6 additions and 4 deletions

View File

@ -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(

View File

@ -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