Skip to content

Commit

Permalink
testcase update
Browse files Browse the repository at this point in the history
Signed-off-by: Shwetha N <[email protected]>
  • Loading branch information
ShwethaSNayak committed Feb 22, 2024
1 parent b73a78e commit 760dde7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/pravega_reader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,13 @@ async def test_largeEvents(self):
self.assertEqual(b'a'*100000, event.data(), "Invalid event data")
r1.release_segment(segment_slice)

# This test is to verify get_streamcut API
async def test_getReaderStreamcut(self):
# This test is to verify get_streamcut API.
# It creates a Pravega stream and writes 4 events.
# Add reader to ReaderGroup which read only first 2 events and release segment slice.
# Reader positions are updated for every 3 secs on acquistion of segments or release segment call so pause for 3 sec before release segment call.
# Get streamcut which has start offset points to 3rd event. Use this streamcut to create new RG
# Now reader in this RG reads remaining to 2 events.
async def test_getStreamcut(self):
suffix = str(random.randint(0, 100))
scope = "testReaderSC"
stream = "testStream" + suffix
Expand All @@ -336,8 +341,6 @@ async def test_getReaderStreamcut(self):
print("Creating a stream ", stream)
stream_result = stream_manager.create_stream(scope, stream, 1)
print(stream_result)

print("Creating a writer for Stream")
w1 = stream_manager.create_writer(scope, stream)

print("Write 4 events")
Expand Down Expand Up @@ -377,7 +380,7 @@ async def test_getReaderStreamcut(self):
r2 = reader_group2.create_reader("reader-2")
segment_slice2 = await r2.get_segment_slice_async()
print(segment_slice2)
countnew=1
countnew=0
for event in segment_slice2:
countnew+=1
print(event.data())
Expand Down

0 comments on commit 760dde7

Please sign in to comment.