[GH-ISSUE #1208] Unit Test Failures on v3.11 #822

Closed
opened 2026-02-25 23:43:41 +03:00 by kerem · 1 comment
Owner

Originally created by @aque on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1208

I encountered 2 minor unit test failures with v3.11. I have SITE_ROOT defined with my self-hosted URL when I started ./manage.py test.

======================================================================
FAIL: test_it_works (hc.api.tests.test_get_check.GetCheckTestCase.test_it_works)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/healthchecks/hc/api/tests/test_get_check.py", line 70, in test_it_works
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        doc["badge_url"], f"http://localhost:8000/b/2/{self.a1.badge_key}.svg"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: 'https://hc.webst.tld/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg' != 'http://localhost:8000/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg'
- https://hc.webst.tld/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg
?     -   ^ -  ^^^^^^^
+ http://localhost:8000/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg
?        ^^   ^^^^^^^^^


======================================================================
FAIL: test_status_text_shows_elapsed_run_time (hc.front.tests.test_status_single.StatusSingleTestCase.test_status_text_shows_elapsed_run_time)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/healthchecks/hc/front/tests/test_status_single.py", line 41, in test_status_text_shows_elapsed_run_time
    self.assertIn("Currently running, started 1 min 0 sec ago.", doc["status_text"])
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Currently running, started 1 min 0 sec ago.' not found in '\n\n    \n        This check is ready for pings.\n    \n\n    \n        <br />\n
       Currently running, started 1 min 1 sec ago.\n    \n\n'

----------------------------------------------------------------------
Ran 1657 tests in 3196.876s

FAILED (failures=2, skipped=3)
Originally created by @aque on GitHub (Aug 31, 2025). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1208 I encountered 2 minor unit test failures with v3.11. I have `SITE_ROOT` defined with my self-hosted URL when I started `./manage.py test`. ``` ====================================================================== FAIL: test_it_works (hc.api.tests.test_get_check.GetCheckTestCase.test_it_works) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/healthchecks/hc/api/tests/test_get_check.py", line 70, in test_it_works self.assertEqual( ~~~~~~~~~~~~~~~~^ doc["badge_url"], f"http://localhost:8000/b/2/{self.a1.badge_key}.svg" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ AssertionError: 'https://hc.webst.tld/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg' != 'http://localhost:8000/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg' - https://hc.webst.tld/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg ? - ^ - ^^^^^^^ + http://localhost:8000/b/2/223f651c-c85f-4461-bdb7-dc74351f2be1.svg ? ^^ ^^^^^^^^^ ====================================================================== FAIL: test_status_text_shows_elapsed_run_time (hc.front.tests.test_status_single.StatusSingleTestCase.test_status_text_shows_elapsed_run_time) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/src/healthchecks/hc/front/tests/test_status_single.py", line 41, in test_status_text_shows_elapsed_run_time self.assertIn("Currently running, started 1 min 0 sec ago.", doc["status_text"]) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'Currently running, started 1 min 0 sec ago.' not found in '\n\n \n This check is ready for pings.\n \n\n \n <br />\n Currently running, started 1 min 1 sec ago.\n \n\n' ---------------------------------------------------------------------- Ran 1657 tests in 3196.876s FAILED (failures=2, skipped=3) ```
kerem closed this issue 2026-02-25 23:43:41 +03:00
Author
Owner

@cuu508 commented on GitHub (Aug 31, 2025):

Thanks for the report.

I fixed the first failure here: github.com/healthchecks/healthchecks@95fd10ceb9

The second failure is a timing issue, I think because the test somehow takes more than 1 second to run. I edited the assert to be less timing sensitive: github.com/healthchecks/healthchecks@a97f40907d

<!-- gh-comment-id:3239809744 --> @cuu508 commented on GitHub (Aug 31, 2025): Thanks for the report. I fixed the first failure here: https://github.com/healthchecks/healthchecks/commit/95fd10ceb9572e522c62d47b9120c9be59637584 The second failure is a timing issue, I think because the test somehow takes more than 1 second to run. I edited the assert to be less timing sensitive: https://github.com/healthchecks/healthchecks/commit/a97f40907dd478da0d6d35fdff0cab16fa28a57c
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#822
No description provided.