Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed May 13, 2024
1 parent 1f54e2f commit 84d180a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
17 changes: 5 additions & 12 deletions client/src/announcer/test/t14.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ async fn t14_notifications_start_at_correct_point_in_time_on_fresh_start() {
let now = Utc::now();

dummy_server.set_events(vec![
Event::dummy(0, (now + ChronoDuration::try_seconds(-1).unwrap()).into()),
Event::dummy(0, (now + ChronoDuration::try_seconds(-2).unwrap()).into()),
Event::dummy(1, (now + ChronoDuration::try_seconds(0).unwrap()).into()),
Event::dummy(2, (now + ChronoDuration::try_seconds(1).unwrap()).into()),
Event::dummy(3, (now + ChronoDuration::try_seconds(2).unwrap()).into()),
Event::dummy(4, (now + ChronoDuration::try_seconds(3).unwrap()).into()),
Event::dummy(2, (now + ChronoDuration::try_seconds(2).unwrap()).into()),
Event::dummy(3, (now + ChronoDuration::try_seconds(4).unwrap()).into()),
]);

let client = Client::new(dummy_server.url());
Expand All @@ -30,21 +29,15 @@ async fn t14_notifications_start_at_correct_point_in_time_on_fresh_start() {

crate::assert_future_in!(
announcer.poll(),
now_i + Duration::from_secs(1),
now_i + Duration::from_secs(2),
AnnouncerPollResult::Event(dummy_server.event(2))
);

crate::assert_future_in!(
announcer.poll(),
now_i + Duration::from_secs(2),
now_i + Duration::from_secs(4),
AnnouncerPollResult::Event(dummy_server.event(3))
);

crate::assert_future_in!(
announcer.poll(),
now_i + Duration::from_secs(3),
AnnouncerPollResult::Event(dummy_server.event(4))
);

dummy_server.stop().await;
}
13 changes: 6 additions & 7 deletions client/src/announcer/test/t15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ async fn t15_notifications_start_at_correct_point_in_time_on_fresh_start_with_of
let now = Utc::now();

dummy_server.set_events(vec![
Event::dummy(0, (now + ChronoDuration::try_seconds(-1).unwrap()).into()),
Event::dummy(0, (now + ChronoDuration::try_seconds(-2).unwrap()).into()),
Event::dummy(1, (now + ChronoDuration::try_seconds(0).unwrap()).into()),
Event::dummy(2, (now + ChronoDuration::try_seconds(1).unwrap()).into()),
Event::dummy(3, (now + ChronoDuration::try_seconds(2).unwrap()).into()),
Event::dummy(4, (now + ChronoDuration::try_seconds(3).unwrap()).into()),
Event::dummy(2, (now + ChronoDuration::try_seconds(2).unwrap()).into()),
Event::dummy(3, (now + ChronoDuration::try_seconds(4).unwrap()).into()),
]);

let client = Client::new(dummy_server.url());
Expand All @@ -31,13 +30,13 @@ async fn t15_notifications_start_at_correct_point_in_time_on_fresh_start_with_of
crate::assert_future_in!(
announcer.poll(),
now_i + Duration::from_secs(1),
AnnouncerPollResult::Event(dummy_server.event(3))
AnnouncerPollResult::Event(dummy_server.event(2))
);

crate::assert_future_in!(
announcer.poll(),
now_i + Duration::from_secs(2),
AnnouncerPollResult::Event(dummy_server.event(4))
now_i + Duration::from_secs(3),
AnnouncerPollResult::Event(dummy_server.event(3))
);

dummy_server.stop().await;
Expand Down

0 comments on commit 84d180a

Please sign in to comment.