Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Highly variable duration of truncations (not a database_cleaner issue)

オープン
#705 コメント 1 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
10/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
mysql, rails, ruby
領域
databases, testing

調査の方向性

この issue には、リポジトリのファイル、テスト、エントリポイントが記載されていません。まず、DatabaseCleaner.clean_with(:truncation) 周辺で報告されている MySQL TRUNCATE のタイミングのばらつきを再現し、その挙動がこのプロジェクトに属するものかどうかを判断してください。完了とするには、maintainer が確認した説明、または変更に対する具体的で受け入れられたスコープが必要です。

索引モデルが issue の本文から書いたものです。

説明

I'm sorry to ask my question here, but as I can't find an explanation elsewhere, I'm asking you because I figure you must have a good grasp of the subject.
When I use a DatabaseCleaner.clean_with(:truncation) before launching my rails tests, I get very variable execution times for each drop table query, even though my tables are almost empty.
This varies from 30 to 400 ms, and the slow / fast requests follow each other, so it's as if the MySQL Server is going faster or slower. Do you have an explanation and a way of solving this problem?

$ tail -f log/test.log
D, [2023-10-12T09:17:39.404980 #25359] DEBUG -- :    (45.5ms)  TRUNCATE TABLE `table1`
D, [2023-10-12T09:17:39.438557 #25359] DEBUG -- :    (33.4ms)  TRUNCATE TABLE `table2`
D, [2023-10-12T09:17:39.473029 #25359] DEBUG -- :    (34.3ms)  TRUNCATE TABLE `table3`
D, [2023-10-12T09:17:39.514899 #25359] DEBUG -- :    (41.7ms)  TRUNCATE TABLE `table4`
D, [2023-10-12T09:17:39.631417 #25359] DEBUG -- :    (116.3ms)  TRUNCATE TABLE `table5`
D, [2023-10-12T09:17:39.685199 #25359] DEBUG -- :    (53.3ms)  TRUNCATE TABLE `table6`
D, [2023-10-12T09:17:39.738879 #25359] DEBUG -- :    (53.2ms)  TRUNCATE TABLE `table7`
D, [2023-10-12T09:17:39.809097 #25359] DEBUG -- :    (69.7ms)  TRUNCATE TABLE `table8`
D, [2023-10-12T09:17:39.889177 #25359] DEBUG -- :    (79.6ms)  TRUNCATE TABLE `table9`
D, [2023-10-12T09:17:39.933648 #25359] DEBUG -- :    (44.0ms)  TRUNCATE TABLE `table10`
D, [2023-10-12T09:17:39.992856 #25359] DEBUG -- :    (58.7ms)  TRUNCATE TABLE `table11`
D, [2023-10-12T09:17:40.299925 #25359] DEBUG -- :    (306.6ms)  TRUNCATE TABLE `table12`
D, [2023-10-12T09:17:40.454695 #25359] DEBUG -- :    (154.4ms)  TRUNCATE TABLE `table13`
D, [2023-10-12T09:17:40.590997 #25359] DEBUG -- :    (136.0ms)  TRUNCATE TABLE `table14`
D, [2023-10-12T09:17:40.718787 #25359] DEBUG -- :    (127.3ms)  TRUNCATE TABLE `table15`
D, [2023-10-12T09:17:40.925396 #25359] DEBUG -- :    (206.1ms)  TRUNCATE TABLE `table16`
D, [2023-10-12T09:17:41.103438 #25359] DEBUG -- :    (177.6ms)  TRUNCATE TABLE `table17`
D, [2023-10-12T09:17:41.305653 #25359] DEBUG -- :    (201.8ms)  TRUNCATE TABLE `table18`
D, [2023-10-12T09:17:41.509797 #25359] DEBUG -- :    (203.7ms)  TRUNCATE TABLE `table19`
D, [2023-10-12T09:17:41.756406 #25359] DEBUG -- :    (246.1ms)  TRUNCATE TABLE `table20`
D, [2023-10-12T09:17:42.136319 #25359] DEBUG -- :    (379.4ms)  TRUNCATE TABLE `table21`
D, [2023-10-12T09:17:42.322232 #25359] DEBUG -- :    (185.4ms)  TRUNCATE TABLE `table22`

Thank you for your time !

主要言語
Ruby
スター
3k
フォーク
485
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DatabaseCleaner/database_cleaner のほかの issue

DatabaseCleaner/database_cleaner の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。