@@ -28,7 +28,7 @@ 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_one_frame ( frame, 1 , 0 ) . await . unwrap ( ) ;
31
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
32
32
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
33
33
assert_eq ! ( durable_frame, 0 ) ; // First frame should return max_frame_no = 0
34
34
@@ -56,7 +56,7 @@ 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_one_frame ( frame, 1 , 0 ) . await . unwrap ( ) ;
59
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
60
60
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
61
61
assert_eq ! ( durable_frame, 0 ) ;
62
62
assert_eq ! ( server. frame_count( ) , 1 ) ;
@@ -82,7 +82,7 @@ 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_one_frame ( frame, 1 , i) . await . unwrap ( ) ;
85
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , i, 1 ) . await . unwrap ( ) ;
86
86
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
87
87
assert_eq ! ( durable_frame, i) ;
88
88
assert_eq ! ( sync_ctx. durable_frame_num( ) , i) ;
@@ -108,7 +108,7 @@ 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_one_frame ( frame, 1 , 0 ) . await . unwrap ( ) ;
111
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
112
112
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
113
113
assert_eq ! ( durable_frame, 0 ) ;
114
114
assert_eq ! ( server. frame_count( ) , 1 ) ;
@@ -152,7 +152,7 @@ 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_one_frame ( frame. clone ( ) , 1 , 0 ) . await . unwrap ( ) ;
155
+ let durable_frame = sync_ctx. push_frames ( frame. clone ( ) , 1 , 0 , 1 ) . await . unwrap ( ) ;
156
156
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
157
157
assert_eq ! ( durable_frame, 0 ) ;
158
158
assert_eq ! ( server. frame_count( ) , 1 ) ;
@@ -180,14 +180,14 @@ async fn test_sync_restarts_with_lower_max_frame_no() {
180
180
// This push should fail because we are ahead of the server and thus should get an invalid
181
181
// frame no error.
182
182
sync_ctx
183
- . push_one_frame ( frame. clone ( ) , 1 , frame_no)
183
+ . push_frames ( frame. clone ( ) , 1 , frame_no, 1 )
184
184
. await
185
185
. unwrap_err ( ) ;
186
186
187
187
let frame_no = sync_ctx. durable_frame_num ( ) + 1 ;
188
188
// This then should work because when the last one failed it updated our state of the server
189
189
// durable_frame_num and we should then start writing from there.
190
- sync_ctx. push_one_frame ( frame, 1 , frame_no) . await . unwrap ( ) ;
190
+ sync_ctx. push_frames ( frame, 1 , frame_no, 1 ) . await . unwrap ( ) ;
191
191
}
192
192
193
193
#[ tokio:: test]
@@ -215,7 +215,7 @@ async fn test_sync_context_retry_on_error() {
215
215
server. return_error . store ( true , Ordering :: SeqCst ) ;
216
216
217
217
// First attempt should fail but retry
218
- let result = sync_ctx. push_one_frame ( frame. clone ( ) , 1 , 0 ) . await ;
218
+ let result = sync_ctx. push_frames ( frame. clone ( ) , 1 , 0 , 1 ) . await ;
219
219
assert ! ( result. is_err( ) ) ;
220
220
221
221
// Advance time to trigger retries faster
@@ -228,7 +228,7 @@ async fn test_sync_context_retry_on_error() {
228
228
server. return_error . store ( false , Ordering :: SeqCst ) ;
229
229
230
230
// Next attempt should succeed
231
- let durable_frame = sync_ctx. push_one_frame ( frame, 1 , 0 ) . await . unwrap ( ) ;
231
+ let durable_frame = sync_ctx. push_frames ( frame, 1 , 0 , 1 ) . await . unwrap ( ) ;
232
232
sync_ctx. write_metadata ( ) . await . unwrap ( ) ;
233
233
assert_eq ! ( durable_frame, 0 ) ;
234
234
assert_eq ! ( server. frame_count( ) , 1 ) ;
0 commit comments