-
Notifications
You must be signed in to change notification settings - Fork 3.1k
try partitions #6834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SteffenDE
wants to merge
2
commits into
main
Choose a base branch
from
sd-integration-test-partition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+36
−5
Open
try partitions #6834
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -223,13 +223,20 @@ jobs: | |||||||||||||||
| run: mix docs --warnings-as-errors | ||||||||||||||||
|
|
||||||||||||||||
| integration-test-elixir: | ||||||||||||||||
| name: integration test (OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}}) | ||||||||||||||||
| name: integration test (OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | partition ${{matrix.partition}}) | ||||||||||||||||
|
|
||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||
|
|
||||||||||||||||
| strategy: | ||||||||||||||||
| # Keep running the remaining partitions when one fails, otherwise a single | ||||||||||||||||
| # failing partition hides the results of all the others. | ||||||||||||||||
| fail-fast: false | ||||||||||||||||
| matrix: | ||||||||||||||||
| # Test files are split across Elixir instances via `mix test --partitions`. | ||||||||||||||||
| # Keep this list in sync with the `--partitions` count in the test step below. | ||||||||||||||||
| partition: [1, 2, 3] | ||||||||||||||||
| elixir: ["1.18.4", "1.20.4"] | ||||||||||||||||
| include: | ||||||||||||||||
| - elixir: "1.18.4" | ||||||||||||||||
| otp: "27.3.4.3" | ||||||||||||||||
|
Comment on lines
+239
to
242
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you do something like this we only need to write the versions once (I have something like this in a local branch):
Suggested change
Then update the usage sites to be Makes it easier to bump the versions without accidents. |
||||||||||||||||
|
|
@@ -240,6 +247,7 @@ jobs: | |||||||||||||||
| env: | ||||||||||||||||
| ELIXIR_ASSERT_TIMEOUT: 10000 | ||||||||||||||||
| PHX_CI: true | ||||||||||||||||
| MIX_TEST_PARTITION: ${{ matrix.partition }} | ||||||||||||||||
| # Set to half of the runner vCPU cores to compile deps/NIFs | ||||||||||||||||
| # concurrently across OS processes without CPU oversubscription. | ||||||||||||||||
| # See https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories | ||||||||||||||||
|
|
@@ -254,22 +262,38 @@ jobs: | |||||||||||||||
| - 5432:5432 | ||||||||||||||||
| env: | ||||||||||||||||
| POSTGRES_PASSWORD: postgres | ||||||||||||||||
| # Probe over TCP (-h 127.0.0.1) rather than the Unix socket: initdb runs | ||||||||||||||||
| # a temporary server with `listen_addresses` empty, and a socket probe | ||||||||||||||||
| # reports ready against *that* server, before the real one is listening. | ||||||||||||||||
| options: >- | ||||||||||||||||
| --health-cmd "pg_isready -U postgres" | ||||||||||||||||
| --health-cmd "pg_isready -U postgres -h 127.0.0.1" | ||||||||||||||||
| --health-interval 2s | ||||||||||||||||
| --health-timeout 3s | ||||||||||||||||
| --health-retries 10 | ||||||||||||||||
| --health-start-period 30s | ||||||||||||||||
| mysql: | ||||||||||||||||
| image: mysql:26 | ||||||||||||||||
| ports: | ||||||||||||||||
| - 3306:3306 | ||||||||||||||||
| env: | ||||||||||||||||
| MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||||||||||||||||
| # Things to be aware of: | ||||||||||||||||
| # | ||||||||||||||||
| # 1. Initializing the data directory on first boot takes 30s+ on a slow | ||||||||||||||||
| # runner, which overruns the retry budget below. Probes that fail | ||||||||||||||||
| # during --health-start-period do not consume that budget, and the | ||||||||||||||||
| # first successful probe ends the period early. | ||||||||||||||||
| # 2. The entrypoint starts a temporary server during initialization with | ||||||||||||||||
| # `port: 0` (Unix socket only). `mysqladmin ping -h localhost` uses | ||||||||||||||||
| # the socket, so it reports healthy against that temporary server -- | ||||||||||||||||
| # which is then shut down and restarted. Probing over TCP instead | ||||||||||||||||
| # only succeeds once the real server is listening on 3306. | ||||||||||||||||
| options: >- | ||||||||||||||||
| --health-cmd "mysqladmin ping -h localhost" | ||||||||||||||||
| --health-cmd "mysqladmin ping -h 127.0.0.1 --protocol=TCP" | ||||||||||||||||
| --health-interval 2s | ||||||||||||||||
| --health-timeout 3s | ||||||||||||||||
| --health-retries 10 | ||||||||||||||||
| --health-start-period 60s | ||||||||||||||||
| mssql: | ||||||||||||||||
| image: mcr.microsoft.com/mssql/server:2019-latest | ||||||||||||||||
| env: | ||||||||||||||||
|
|
@@ -323,6 +347,6 @@ jobs: | |||||||||||||||
| - name: Run integration tests | ||||||||||||||||
| working-directory: integration_test | ||||||||||||||||
| run: | | ||||||||||||||||
| mix test --include database \ | ||||||||||||||||
| mix test --include database --partitions 3 \ | ||||||||||||||||
| --formatter ExUnit.CLIFormatter \ | ||||||||||||||||
| --formatter Phoenix.Integration.SummaryFormatter | ||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was something I thought about this week. The previous approach was abort the other Elixir/OTP if one fails.
With or without partitions,
fail-fast: falsegives us complete visibility trading off CPU time. The only constraint here is 2,000 free Actions minutes per month: