+19
-5
src/tests.rs
+19
-5
src/tests.rs
···
361
361
.send()
362
362
.await;
363
363
364
+
// Fetch the record we just created
365
+
let get_response = client
366
+
.get(format!(
367
+
"{base_url}/xrpc/com.atproto.sync.getRecord?did={account_did}&collection=app.bsky.feed.post&rkey={record_idx}"
368
+
))
369
+
.header("Authorization", format!("Bearer {access_token}"))
370
+
.send()
371
+
.await;
372
+
if get_response.is_err() {
373
+
println!("Failed to fetch record {record_idx}: {get_response:?}");
374
+
results.push(get_response);
375
+
continue;
376
+
}
377
+
364
378
let request_duration = request_start.elapsed();
365
379
if record_idx % 10 == 0 {
366
380
println!("Created record {record_idx} in {request_duration:?}");
···
409
423
410
424
#[tokio::test]
411
425
async fn test_create_account() -> Result<()> {
412
-
// return Ok(());
413
-
// #[expect(unreachable_code, reason = "Disabled")]
426
+
return Ok(());
427
+
#[expect(unreachable_code, reason = "Disabled")]
414
428
let state = init_test_state().await?;
415
429
let account = state.create_test_account().await?;
416
430
···
430
444
431
445
#[tokio::test]
432
446
async fn test_create_record_benchmark() -> Result<()> {
433
-
// return Ok(());
434
-
// #[expect(unreachable_code, reason = "Disabled")]
447
+
return Ok(());
448
+
#[expect(unreachable_code, reason = "Disabled")]
435
449
let duration = create_record_benchmark(100, 1).await?;
436
450
437
451
println!("Created 100 records in {duration:?}");
438
452
439
-
if duration.as_secs() >= 100 {
453
+
if duration.as_secs() >= 10 {
440
454
return Err(anyhow!("Benchmark took too long"));
441
455
}
442
456