Skip to content

Commit

Permalink
Improve tests (#446)
Browse files Browse the repository at this point in the history
* Rename TestHelpers to DateHelpers

* Refactor ServerHelpers

* Refactor telemetry testing to use messages instead of waiting

* Refactor log testing to use messages instead of capture_log

* Make tests run sync now that we've made it (mostly) safe

Still a few loose ends to chase down

* Avoid collisions between finch pools for similarly named tests

* Tag off a few intrinsically slow tests to not run locally

* Lower default timeout to 100ms

* Increase wait time for log/telemetry messages to 500ms

* Tweak a few explicitly required sleeps

* Fix 'out of process' tests to work around weird Mint behaviour

* Update SimpleH2Client to provide more info about frame types

* Improve h2 test that is inherently racy

* Add sleeps since it seems as if log handler addition is a bit racy

* Increase Websocket timeouts

(these will go away once we refactor websocket logging to support receive-based testing)

* Increase read timeout on TLS warnings test
  • Loading branch information
mtrudel authored Jan 4, 2025
1 parent 746ad08 commit 32478bb
Show file tree
Hide file tree
Showing 21 changed files with 1,929 additions and 2,142 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autobahn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
elixir: ${{ fromJSON(inputs.elixirs) }}
otp: ${{ fromJSON(inputs.erlangs) }}
case:
case:
- "1.*,2.*,3.*,4.*,5.*,6.*,7.*,8.*,10.*"
- "9.1.*"
- "9.2.*"
Expand Down Expand Up @@ -69,4 +69,4 @@ jobs:
run: |
mix deps.get
- name: Run Autobahn test
run: mix test --only external_conformance test/bandit/websocket/autobahn_test.exs
run: mix test --only slow test/bandit/websocket/autobahn_test.exs
2 changes: 1 addition & 1 deletion .github/workflows/h2spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
run: |
mix deps.get
- name: Run h2spec test
run: mix test --only external_conformance test/bandit/http2/h2spec_test.exs
run: mix test --only slow test/bandit/http2/h2spec_test.exs
2 changes: 1 addition & 1 deletion test/bandit/clock_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule ClockTest do
warnings =
capture_log(fn ->
{"date", date} = Bandit.Clock.date_header()
assert TestHelpers.valid_date_header?(date)
assert DateHelpers.valid_date_header?(date)
end)

assert warnings =~ "Header timestamp couldn't be fetched from ETS cache"
Expand Down
Loading

0 comments on commit 32478bb

Please sign in to comment.