Skip to content
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

(実験用)並列テスト #36

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

(実験用)並列テスト #36

wants to merge 5 commits into from

Conversation

hotate29
Copy link
Owner

@hotate29 hotate29 commented Nov 8, 2022

実験用

@hotate29
Copy link
Owner Author

hotate29 commented Nov 8, 2022

データベースを使うテストで#[sqlx::test]を使って、テストごとにデータベースを作成することで並列にテストができるようにした。

https://docs.rs/sqlx/latest/sqlx/attr.test.html

この変更によって、バックエンドのテストで--test-threads=1を付ける必要が無くなる。

手元環境(Windows11, Docker Desktop 4.13.1, Ryzen5 3600 6C12T, 32GB RAM)では20秒かかっていたテストが15秒になった。5秒かあ...

GtiHub Actionsでは逆に時間が延びるぽい。いまいち

image

@hotate29 hotate29 changed the title 並列テスト (実験用)並列テスト Nov 8, 2022
@hotate29
Copy link
Owner Author

hotate29 commented Nov 10, 2022

GitHub Actionsでの効果について、workflow.ymlでスレッド数を制限したまま実行しているのに気が付いたので、制限を無くして再度実行した。

並列テストを有効にすると、無効時と比べて5秒程度短縮された(一回しか試していないし、これ以上試す気もないので信用できない数字ではある)。
これらの変更を加える前の実行時間と比べるとやはり若干遅くなっているのだが、ローカル環境では早くなるし良いんじゃない?という気持ちになってきた。ローカルの方が頻繁にテストを行うので。

@hotate29
Copy link
Owner Author

hotate29 commented Mar 9, 2023

テスト実行とビルドを分割してわかりやすくなったけど、そもそも実行に30秒程度しかかかっていないんだよな。テスト実行(とそれに伴うビルド)を早くしたい目的でいじってきたけど、それなら1分半かかっているビルドを改善する方が筋がいいように見える。

@hotate29
Copy link
Owner Author

トランザクションを実験してみる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant