Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions geyser-plugin/src/account_update_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ mod tests {
}

#[test]
fn confirmed_startup_replay_updates_are_suppressed() {
fn test_confirmed_startup_replay_updates_are_suppressed() {
assert!(matches!(
should_publish_confirmed_account(&AccountSubscriptions::new(), &sample_event(true)),
AccountUpdatePublishOutcome::SkippedStartupReplay
));
}

#[test]
fn backfill_snapshots_are_suppressed_after_live_updates() {
fn test_backfill_snapshots_are_suppressed_after_live_updates() {
assert!(matches!(
should_publish_backfill_account(&AccountSubscriptions::new(), [7; 32], true),
AccountUpdatePublishOutcome::SkippedLiveUpdateWon
Expand Down
26 changes: 13 additions & 13 deletions geyser-plugin/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ mod tests {
}

#[test]
fn parses_valid_minimal_config() {
fn test_parses_valid_minimal_config() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -233,7 +233,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_missing_admin() {
fn test_rejects_missing_admin() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -252,7 +252,7 @@ local_rpc_url = "http://127.0.0.1:8899"
}

#[test]
fn rejects_missing_kafka_topic() {
fn test_rejects_missing_kafka_topic() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -271,7 +271,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_missing_bootstrap_servers() {
fn test_rejects_missing_bootstrap_servers() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -291,7 +291,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_legacy_filter_fields() {
fn test_rejects_legacy_filter_fields() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -312,7 +312,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn parses_config_with_metrics_enabled() {
fn test_parses_config_with_metrics_enabled() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -333,7 +333,7 @@ metrics = true
}

#[test]
fn metrics_defaults_to_false() {
fn test_metrics_defaults_to_false() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -353,7 +353,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn parses_config_without_ksql_startup_restore_url() {
fn test_parses_config_without_ksql_startup_restore_url() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -373,7 +373,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn parses_config_with_valid_ksql_startup_restore_url() {
fn test_parses_config_with_valid_ksql_startup_restore_url() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -396,7 +396,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_empty_ksql_startup_restore_url() {
fn test_rejects_empty_ksql_startup_restore_url() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -419,7 +419,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_ksql_startup_restore_url_without_scheme() {
fn test_rejects_ksql_startup_restore_url_without_scheme() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -442,7 +442,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn rejects_ksql_startup_restore_url_without_host() {
fn test_rejects_ksql_startup_restore_url_without_host() {
let error = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand All @@ -465,7 +465,7 @@ admin = "127.0.0.1:8080"
}

#[test]
fn passes_through_kafka_client_overrides() {
fn test_passes_through_kafka_client_overrides() {
let config = parse_config(
r#"
libpath = "target/release/libsolana_accountsdb_plugin_kafka.so"
Expand Down
24 changes: 12 additions & 12 deletions geyser-plugin/src/confirmation_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ mod tests {
}

#[test]
fn buffers_latest_update_per_slot_pubkey() {
fn test_buffers_latest_update_per_slot_pubkey() {
let mut confirmed = ConfirmedAccounts::new();

confirmed.record_account(account_event(10, 1, 1));
Expand All @@ -398,7 +398,7 @@ mod tests {
}

#[test]
fn confirmed_slot_drains_updates_once() {
fn test_confirmed_slot_drains_updates_once() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(11, 2, 1));

Expand All @@ -423,7 +423,7 @@ mod tests {
}

#[test]
fn rooted_slot_drains_updates_once() {
fn test_rooted_slot_drains_updates_once() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(12, 3, 1));

Expand All @@ -442,7 +442,7 @@ mod tests {
}

#[test]
fn confirmed_child_confirms_known_ancestors() {
fn test_confirmed_child_confirms_known_ancestors() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(20, 4, 1));
confirmed.record_account(account_event(21, 5, 1));
Expand All @@ -469,7 +469,7 @@ mod tests {
}

#[test]
fn confirmed_with_missing_parent_stops_inference() {
fn test_confirmed_with_missing_parent_stops_inference() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(30, 7, 1));

Expand All @@ -488,7 +488,7 @@ mod tests {
}

#[test]
fn confirmed_event_with_parent_none_uses_previous_parent_link() {
fn test_confirmed_event_with_parent_none_uses_previous_parent_link() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(40, 8, 1));
confirmed.record_account(account_event(41, 9, 1));
Expand All @@ -511,7 +511,7 @@ mod tests {
}

#[test]
fn dead_slot_removes_own_updates() {
fn test_dead_slot_removes_own_updates() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(50, 10, 1));

Expand All @@ -527,7 +527,7 @@ mod tests {
}

#[test]
fn dead_slot_removes_known_descendants() {
fn test_dead_slot_removes_known_descendants() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(60, 11, 1));
confirmed.record_account(account_event(61, 12, 1));
Expand All @@ -548,7 +548,7 @@ mod tests {
}

#[test]
fn dead_slot_prevents_later_emission() {
fn test_dead_slot_prevents_later_emission() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(70, 13, 1));
confirmed.record_slot_status(70, None, InternalSlotStatus::Dead);
Expand All @@ -565,7 +565,7 @@ mod tests {
}

#[test]
fn repeated_confirmed_status_is_idempotent() {
fn test_repeated_confirmed_status_is_idempotent() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(80, 14, 1));

Expand All @@ -581,7 +581,7 @@ mod tests {
}

#[test]
fn stale_fallback_evicts_old_unconfirmed_slots() {
fn test_stale_fallback_evicts_old_unconfirmed_slots() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(1, 15, 1));

Expand All @@ -601,7 +601,7 @@ mod tests {
}

#[test]
fn stale_fallback_does_not_evict_confirmed_slots() {
fn test_stale_fallback_does_not_evict_confirmed_slots() {
let mut confirmed = ConfirmedAccounts::new();
confirmed.record_account(account_event(2, 16, 1));
let _ = confirmed.record_slot_status(2, None, InternalSlotStatus::Confirmed);
Expand Down
12 changes: 6 additions & 6 deletions geyser-plugin/src/initial_account_backfill/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ mod tests {
}

#[test]
fn existing_account_maps_to_expected_update_event() {
fn test_existing_account_maps_to_expected_update_event() {
let event = rpc::map_existing_account(
Account {
lamports: 42,
Expand Down Expand Up @@ -412,7 +412,7 @@ mod tests {
}

#[test]
fn missing_account_maps_to_sentinel_event() {
fn test_missing_account_maps_to_sentinel_event() {
let event = rpc::map_missing_account(55, pk(2));

assert_eq!(event.slot, 55);
Expand All @@ -430,7 +430,7 @@ mod tests {
}

#[test]
fn enqueue_marks_pubkeys_in_flight() {
fn test_enqueue_marks_pubkeys_in_flight() {
let (inner, _rx) = test_inner(4);
let handle = InitialAccountBackfillHandle { inner };

Expand All @@ -443,7 +443,7 @@ mod tests {
}

#[test]
fn mark_live_update_seen_flips_in_flight_state() {
fn test_mark_live_update_seen_flips_in_flight_state() {
let (inner, _rx) = test_inner(4);
let handle = InitialAccountBackfillHandle { inner };
let pubkey = pk(3);
Expand All @@ -462,7 +462,7 @@ mod tests {
}

#[test]
fn complete_backfill_event_suppresses_when_live_update_won_race() {
fn test_complete_backfill_event_suppresses_when_live_update_won_race() {
let (inner, _rx) = test_inner(4);
let handle = InitialAccountBackfillHandle {
inner: inner.clone(),
Expand All @@ -478,7 +478,7 @@ mod tests {
}

#[test]
fn enqueue_failure_cleans_up_temporary_in_flight_markers() {
fn test_enqueue_failure_cleans_up_temporary_in_flight_markers() {
let (inner, mut rx) = test_inner(1);
inner
.tx
Expand Down
14 changes: 7 additions & 7 deletions geyser-plugin/src/ksql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ mod tests {
}

#[test]
fn parses_header_and_valid_rows() {
fn test_parses_header_and_valid_rows() {
let body = concat!(
"{\"queryId\":\"query_1\"}\n",
"[\"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=\"]\n"
Expand All @@ -148,7 +148,7 @@ mod tests {
}

#[test]
fn parses_multiple_valid_rows() {
fn test_parses_multiple_valid_rows() {
let body = concat!(
"[\"AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=\"]\n",
"[\"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI=\"]\n"
Expand All @@ -160,7 +160,7 @@ mod tests {
}

#[test]
fn rejects_ksql_error_rows() {
fn test_rejects_ksql_error_rows() {
let error = parse_pubkeys_stream("{\"@type\":\"error\",\"message\":\"boom\"}\n".as_bytes())
.unwrap_err()
.to_string();
Expand All @@ -169,7 +169,7 @@ mod tests {
}

#[test]
fn rejects_non_array_data_rows() {
fn test_rejects_non_array_data_rows() {
let error = parse_pubkeys_stream("\"nope\"\n".as_bytes())
.unwrap_err()
.to_string();
Expand All @@ -178,7 +178,7 @@ mod tests {
}

#[test]
fn rejects_wrong_column_count() {
fn test_rejects_wrong_column_count() {
let error = parse_pubkeys_stream("[\"a\",\"b\"]\n".as_bytes())
.unwrap_err()
.to_string();
Expand All @@ -187,7 +187,7 @@ mod tests {
}

#[test]
fn rejects_invalid_base64() {
fn test_rejects_invalid_base64() {
let error = parse_pubkeys_stream("[\"not-base64\"]\n".as_bytes())
.unwrap_err()
.to_string();
Expand All @@ -196,7 +196,7 @@ mod tests {
}

#[test]
fn rejects_wrong_pubkey_length() {
fn test_rejects_wrong_pubkey_length() {
let error = parse_pubkeys_stream("[\"AQ==\"]\n".as_bytes())
.unwrap_err()
.to_string();
Expand Down
8 changes: 4 additions & 4 deletions geyser-plugin/src/plugin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ mod tests {
}

#[test]
fn restore_tracking_from_ksql_is_noop_when_disabled() {
fn test_restore_tracking_from_ksql_is_noop_when_disabled() {
let config = Config::default();
let subs = AccountSubscriptions::new();
let initial_account_backfill =
Expand All @@ -381,7 +381,7 @@ mod tests {
}

#[test]
fn restore_pubkeys_in_chunks_deduplicates_before_subscribing() {
fn test_restore_pubkeys_in_chunks_deduplicates_before_subscribing() {
let subs = AccountSubscriptions::new();
let test_handle = InitialAccountBackfillHandle::new_test(8);

Expand All @@ -399,7 +399,7 @@ mod tests {
}

#[test]
fn restore_pubkeys_in_chunks_handles_chunk_boundaries() {
fn test_restore_pubkeys_in_chunks_handles_chunk_boundaries() {
let subs = AccountSubscriptions::new();
let test_handle = InitialAccountBackfillHandle::new_test(8);
let pubkeys = (0..=INIT_TRACKING_RESTORE_CHUNK_SIZE)
Expand All @@ -422,7 +422,7 @@ mod tests {
}

#[test]
fn restore_pubkeys_in_chunks_aborts_when_queue_is_full() {
fn test_restore_pubkeys_in_chunks_aborts_when_queue_is_full() {
let subs = AccountSubscriptions::new();
let test_handle = InitialAccountBackfillHandle::new_test(1);
test_handle.prefill_queue_for_test(vec![pk(9)]);
Expand Down
Loading