diff options
Diffstat (limited to 'tests/sync/historic_sync.rs')
| -rw-r--r-- | tests/sync/historic_sync.rs | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/sync/historic_sync.rs b/tests/sync/historic_sync.rs index aec2819..723b776 100644 --- a/tests/sync/historic_sync.rs +++ b/tests/sync/historic_sync.rs | |||
| @@ -224,34 +224,24 @@ async fn test_history_sync_without_negentropy() { | |||
| 224 | // Create keys | 224 | // Create keys |
| 225 | let keys = Keys::generate(); | 225 | let keys = Keys::generate(); |
| 226 | 226 | ||
| 227 | // Create announcement listing BOTH relay domains | 227 | // Set up announcement on source with git data |
| 228 | // This event will exist on source BEFORE syncing relay ever connects | 228 | // (purgatory requires git data before announcements are accepted) |
| 229 | let announcement = create_repo_announcement( | 229 | let domains = vec![source.domain(), syncing_domain.clone()]; |
| 230 | let domain_refs: Vec<&str> = domains.iter().map(|s| s.as_str()).collect(); | ||
| 231 | let (announcement, _git_dir) = setup_announcement_on_relay( | ||
| 232 | &source, | ||
| 230 | &keys, | 233 | &keys, |
| 231 | &[&source.domain(), &syncing_domain], | 234 | &domain_refs, |
| 232 | "test-repo-history-no-negentropy", | 235 | "test-repo-history-no-negentropy", |
| 233 | ); | 236 | ) |
| 237 | .await; | ||
| 234 | let announcement_id = announcement.id; | 238 | let announcement_id = announcement.id; |
| 235 | 239 | ||
| 236 | println!( | 240 | println!( |
| 237 | "Created announcement {} (kind {})", | 241 | "Announcement {} set up on source with git data (event exists BEFORE syncing relay connects)", |
| 238 | announcement_id, | 242 | announcement_id |
| 239 | announcement.kind.as_u16() | ||
| 240 | ); | 243 | ); |
| 241 | 244 | ||
| 242 | // Send announcement to source (event now exists BEFORE syncing relay connects) | ||
| 243 | let client = TestClient::new(source.url(), keys.clone()) | ||
| 244 | .await | ||
| 245 | .expect("Failed to connect to source"); | ||
| 246 | |||
| 247 | client | ||
| 248 | .send_event(&announcement) | ||
| 249 | .await | ||
| 250 | .expect("Failed to send announcement to source"); | ||
| 251 | println!("Announcement sent to source (event exists BEFORE syncing relay connects)"); | ||
| 252 | |||
| 253 | client.disconnect().await; | ||
| 254 | |||
| 255 | // Wait to ensure event is stored | 245 | // Wait to ensure event is stored |
| 256 | tokio::time::sleep(Duration::from_millis(500)).await; | 246 | tokio::time::sleep(Duration::from_millis(500)).await; |
| 257 | 247 | ||