test: introduce test jail to hide lewis' sins
We've got a bunch of tests that never pass because they time out on their own, or that take 10s because they test a 10s timeout, that we can rethink. Together they introduce a lot of slowness. This puts anything over 10s in CI into test jail.
97 unmodified lines989910010110210210310410510623 unmodified lines13013113213313413513613713813914014161 unmodified lines97 unmodified linestest-unit: SQLX_OFFLINE=true cargo test --test it -- dpop_unit:: validation_edge_cases:: scope_edge_cases::
store_run := "SQLX_OFFLINE=true TRANQUIL_TEST_BACKEND=store TRANQUIL_PDS_ALLOW_INSECURE_SECRETS=1 DISABLE_RATE_LIMITING=1 TRANQUIL_LEXICON_OFFLINE=1 SKIP_IMPORT_VERIFICATION=true cargo nextest run --workspace --exclude tranquil-store --features tranquil-store/skip-fsync,tranquil-api/low-bcrypt-cost"store_test := store_run + " -E 'not (binary(it) and test(/^store_parity::/)) and not (package(tranquil-signal) and test(/^tests::/))'"store_test := store_run + " -E 'not (binary(it) and test(/^store_parity::/)) and not (package(tranquil-signal) and test(/^tests::/)) and not test(~jail_)'"
test-auth: {{store_run}} --test it -E 'test(/^(oauth|oauth_lifecycle|oauth_scopes|oauth_security|jwt_security|session_management|change_password|password_reset)::/)'
23 unmodified lines
test *args: {{store_test}} {{args}}
# these tests stay in jail until lewis makes them behavetest-jail *args: {{store_run}} -E 'test(~jail_)' {{args}}
test-one name: {{store_run}} --test it -E 'test(/^{{name}}::/)'
test-full *args:61 unmodified lines393 unmodified linesExpand all3943953963973983983994004014028 unmodified lines393 unmodified linesExpand all );}
#[tokio::test]async fn test_plc_server_timeout() {async fn jail_test_plc_server_timeout() { let plc_server = MockServer::start().await; let did = "did:plc:timeout123";
Mock::given(method("GET"))8 unmodified lines1325 unmodified linesExpand all132613271328132913301330133113321333133432 unmodified lines136713681369137013711371137213731374137540 unmodified lines1325 unmodified linesExpand all shutdown.cancel(); }
#[tokio::test] async fn timed_out_write_resets_stream_instead_of_truncating() { async fn jail_timed_out_write_resets_stream_instead_of_truncating() { let shutdown = CancellationToken::new(); let (sender, _rx_sender) = Transport::bind("127.0.0.1:0".parse().unwrap(), None, shutdown.clone()) .await32 unmodified lines shutdown.cancel(); }
#[tokio::test] async fn write_timeout_keeps_connection() { async fn jail_write_timeout_keeps_connection() { use futures::StreamExt;
let shutdown = CancellationToken::new(); let (sender, _rx_sender) =40 unmodified lines685 unmodified linesExpand all686687688689690690691692693694344 unmodified linesExpand all685 unmodified linesExpand all })}
#[tokio::test]async fn cross_node_rate_limit_via_login() {async fn jail_cross_node_rate_limit_via_login() { let nodes = crate::common::cluster().await; let client = crate::common::client();
let now_ms = u64::try_from(344 unmodified linesExpand all1166 unmodified linesExpand all1167116811691170117111711172117311741175102 unmodified linesExpand all1278127912801281128212821283128412851286402 unmodified linesExpand all1689169016911692169316931694169516961697229 unmodified linesExpand all1166 unmodified linesExpand all assert_eq!(profile_res.status(), StatusCode::OK);}
#[tokio::test]async fn test_scale_1000_posts_with_pagination() {async fn jail_test_scale_1000_posts_with_pagination() { let client = client(); let base = base_url().await; let (did, jwt) = setup_new_user("scale-posts").await;
102 unmodified linesExpand all );}
#[tokio::test]async fn test_scale_many_users_social_graph() {async fn jail_test_scale_many_users_social_graph() { let client = client(); let base = base_url().await;
let user_count = 50;402 unmodified linesExpand all );}
#[tokio::test]async fn test_scale_reply_thread_depth() {async fn jail_test_scale_reply_thread_depth() { let client = client(); let base = base_url().await; let (did, jwt) = setup_new_user("deep-thread").await;
229 unmodified linesExpand all