Skip to content

Commit

Permalink
Fix up TestChunkStreamRingRing::test_missing_chunks
Browse files Browse the repository at this point in the history
It was failing because the indexing wasn't accounting for the missing
chunks.
  • Loading branch information
bmerry committed Jul 4, 2023
1 parent 8bfdac7 commit fbf2f7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_recv_chunk_stream_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def _send_data(self, send_stream, data, eviction_mode, heaps=None):

def _verify(self, group, data, expected_present, chunk_id_bias=0):
expected_present = expected_present.reshape(-1, HEAPS_PER_CHUNK)
expected_chunk_ids = np.nonzero(np.any(expected_present, axis=1))[0]
chunks = len(expected_present)
data_by_heap = data.reshape(chunks, HEAPS_PER_CHUNK, -1)

Expand All @@ -279,7 +280,7 @@ def next_real_chunk():
else:
group.add_free_chunk(chunk)

for i in range(len(expected_present)):
for i in expected_chunk_ids:
chunk = next_real_chunk()
assert chunk.chunk_id == i + chunk_id_bias
np.testing.assert_equal(chunk.present, expected_present[i])
Expand Down

0 comments on commit fbf2f7a

Please sign in to comment.