Skip to content

Commit b102fbc

Browse files
committed
Fix tests
1 parent 8effd0d commit b102fbc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

services/app/apps/codebattle/lib/codebattle/users_points_and_rank_update_server.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ defmodule Codebattle.UsersPointsAndRankUpdateServer do
5454

5555
# Recalculate user points when a non-open tournament finishes
5656
# Open tournaments are excluded from point recalculation as they don't affect user ratings
57-
def handle_info(%{event: "tournament:finished", payload: %{grade: grade}}, state) when grade != "open" do
58-
:timer.sleep(300)
57+
def handle_info(%{event: "tournament:finished", payload: %{grade: grade}}, state)
58+
when grade != "open" do
59+
:timer.sleep(:timer.seconds(0.5))
5960
do_work()
6061
{:noreply, state}
6162
end

services/app/apps/codebattle/test/codebattle/tournament/entire/swiss_grand_slam_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ defmodule Codebattle.Tournament.Entire.SwissGrandSlamTest do
410410
}
411411
] = TournamentUserResult |> Repo.all() |> Enum.sort_by(& &1.user_id)
412412

413-
:timer.sleep(1000)
413+
:timer.sleep(:timer.seconds(2))
414414
assert %{rating: 1023, rank: 1, points: 2048} = Repo.get(User, u1_id)
415415
assert %{rating: 977, rank: 2, points: 1024} = Repo.get(User, u2_id)
416416
end

0 commit comments

Comments
 (0)