[relay] Calls: a long-poll on the fetch route, TURN credentials for coturn, wakes every 10 s; the module passes the TURN secret by systemd credential

This commit is contained in:
2026-12-03 00:29:07 +01:00
parent 1e2eed8e5b
commit 776e4ce39b
15 changed files with 654 additions and 22 deletions
+5 -3
View File
@@ -277,7 +277,9 @@ async fn a_post_wakes_with_a_constant_and_nothing_of_the_mailbox_or_the_blob() {
}
#[tokio::test(flavor = "multi_thread")]
async fn a_mailbox_is_woken_at_most_once_a_minute() {
async fn a_mailbox_is_woken_at_most_once_every_ten_seconds() {
// Ten since 2026-12-03, so a call right after a message still wakes a closed app (calls-relay.md).
assert_eq!(WAKE_EVERY_SECS, 10);
let relay = Relay::new(true);
let push = PushServer::start().await;
let m = relay.mailbox().await;
@@ -288,10 +290,10 @@ async fn a_mailbox_is_woken_at_most_once_a_minute() {
assert_eq!(push.wait_for(1).await.len(), 1);
relay.advance(WAKE_EVERY_SECS - 1);
relay.post(&m, &m.post, b"y").await;
assert_eq!(push.quiet().await.len(), 1, "within the minute");
assert_eq!(push.quiet().await.len(), 1, "within the ten seconds");
relay.advance(1);
relay.post(&m, &m.post, b"z").await;
assert_eq!(push.wait_for(2).await.len(), 2, "after the minute");
assert_eq!(push.wait_for(2).await.len(), 2, "after them");
// Another mailbox has its own minute.
let other = relay.mailbox().await;
relay