Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
621B

  1. defmodule Pleroma.HealthcheckTest do
  2. use Pleroma.DataCase
  3. alias Pleroma.Healthcheck
  4. test "system_info/0" do
  5. result = Healthcheck.system_info() |> Map.from_struct()
  6. assert Map.keys(result) == [:active, :healthy, :idle, :memory_used, :pool_size]
  7. end
  8. describe "check_health/1" do
  9. test "pool size equals active connections" do
  10. result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 10})
  11. refute result.healthy
  12. end
  13. test "chech_health/1" do
  14. result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 9})
  15. assert result.healthy
  16. end
  17. end
  18. end