@@ -28,9 +28,9 @@ async fn test_sync_context_push_frame() {
28
28
let mut sync_ctx = sync_ctx;
29
29
30
30
// Push a frame and verify the response
31
- let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
31
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 , None ) . await . unwrap ( ) ;
32
32
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
33
- assert_eq ! ( durable_frame, 0 ) ; // First frame should return max_frame_no = 0
33
+ assert_eq ! ( durable_frame. max_frame_no , 0 ) ; // First frame should return max_frame_no = 0
34
34
35
35
// Verify internal state was updated
36
36
assert_eq ! ( sync_ctx. durable_frame_num( ) , 0 ) ;
@@ -56,9 +56,9 @@ async fn test_sync_context_with_auth() {
56
56
let frame = Bytes :: from ( "test frame with auth" ) ;
57
57
let mut sync_ctx = sync_ctx;
58
58
59
- let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
59
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 , None ) . await . unwrap ( ) ;
60
60
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
61
- assert_eq ! ( durable_frame, 0 ) ;
61
+ assert_eq ! ( durable_frame. max_frame_no , 0 ) ;
62
62
assert_eq ! ( server. frame_count( ) , 1 ) ;
63
63
}
64
64
@@ -82,9 +82,9 @@ async fn test_sync_context_multiple_frames() {
82
82
// Push multiple frames and verify incrementing frame numbers
83
83
for i in 0 ..3 {
84
84
let frame = Bytes :: from ( format ! ( "frame data {}" , i) ) ;
85
- let durable_frame = sync_ctx. push_frames ( frame, 1 , i, 1 ) . await . unwrap ( ) ;
85
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , i, 1 , None ) . await . unwrap ( ) ;
86
86
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
87
- assert_eq ! ( durable_frame, i) ;
87
+ assert_eq ! ( durable_frame. max_frame_no , i) ;
88
88
assert_eq ! ( sync_ctx. durable_frame_num( ) , i) ;
89
89
assert_eq ! ( server. frame_count( ) , i + 1 ) ;
90
90
}
@@ -108,9 +108,9 @@ async fn test_sync_context_corrupted_metadata() {
108
108
109
109
let mut sync_ctx = sync_ctx;
110
110
let frame = Bytes :: from ( "test frame data" ) ;
111
- let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
111
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 , None ) . await . unwrap ( ) ;
112
112
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
113
- assert_eq ! ( durable_frame, 0 ) ;
113
+ assert_eq ! ( durable_frame. max_frame_no , 0 ) ;
114
114
assert_eq ! ( server. frame_count( ) , 1 ) ;
115
115
116
116
// Update metadata path to use -info instead of .meta
@@ -152,9 +152,12 @@ async fn test_sync_restarts_with_lower_max_frame_no() {
152
152
153
153
let mut sync_ctx = sync_ctx;
154
154
let frame = Bytes :: from ( "test frame data" ) ;
155
- let durable_frame = sync_ctx. push_frames ( frame. clone ( ) , 1 , 0 , 1 ) . await . unwrap ( ) ;
155
+ let durable_frame = sync_ctx
156
+ . push_frames ( frame. clone ( ) , 1 , 0 , 1 , None )
157
+ . await
158
+ . unwrap ( ) ;
156
159
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
157
- assert_eq ! ( durable_frame, 0 ) ;
160
+ assert_eq ! ( durable_frame. max_frame_no , 0 ) ;
158
161
assert_eq ! ( server. frame_count( ) , 1 ) ;
159
162
160
163
// Bump the durable frame num so that the next time we call the
@@ -180,14 +183,17 @@ async fn test_sync_restarts_with_lower_max_frame_no() {
180
183
// This push should fail because we are ahead of the server and thus should get an invalid
181
184
// frame no error.
182
185
sync_ctx
183
- . push_frames ( frame. clone ( ) , 1 , frame_no, 1 )
186
+ . push_frames ( frame. clone ( ) , 1 , frame_no, 1 , None )
184
187
. await
185
188
. unwrap_err ( ) ;
186
189
187
190
let frame_no = sync_ctx. durable_frame_num ( ) + 1 ;
188
191
// This then should work because when the last one failed it updated our state of the server
189
192
// durable_frame_num and we should then start writing from there.
190
- sync_ctx. push_frames ( frame, 1 , frame_no, 1 ) . await . unwrap ( ) ;
193
+ sync_ctx
194
+ . push_frames ( frame, 1 , frame_no, 1 , None )
195
+ . await
196
+ . unwrap ( ) ;
191
197
}
192
198
193
199
#[ tokio:: test]
@@ -215,7 +221,7 @@ async fn test_sync_context_retry_on_error() {
215
221
server. return_error . store ( true , Ordering :: SeqCst ) ;
216
222
217
223
// First attempt should fail but retry
218
- let result = sync_ctx. push_frames ( frame. clone ( ) , 1 , 0 , 1 ) . await ;
224
+ let result = sync_ctx. push_frames ( frame. clone ( ) , 1 , 0 , 1 , None ) . await ;
219
225
assert ! ( result. is_err( ) ) ;
220
226
221
227
// Advance time to trigger retries faster
@@ -228,9 +234,9 @@ async fn test_sync_context_retry_on_error() {
228
234
server. return_error . store ( false , Ordering :: SeqCst ) ;
229
235
230
236
// Next attempt should succeed
231
- let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
237
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 , None ) . await . unwrap ( ) ;
232
238
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
233
- assert_eq ! ( durable_frame, 0 ) ;
239
+ assert_eq ! ( durable_frame. max_frame_no , 0 ) ;
234
240
assert_eq ! ( server. frame_count( ) , 1 ) ;
235
241
}
236
242
0 commit comments