Race Conditions when Tests run in Parallel for Functions with File I/O Capabailities

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

メンテナーはふだん 2 日以内に返信

@JZahner1 がすでに取り組んでいます。

2026年11月2日 から。

評価

この issue はまだ評価されていません。

説明

bug

the addition of the "extract_sis_data" tests results in a race condition with the "save_all_plots" test, due to coincident file writing and deletion to the same directory. How would you like to handle this? One way is to merge the two sets of tests, since testthat/parallel runs test files in parallel rather than functions. This feels like a bad way to fix this issue. Another way would be to this would be have each test write figures and temp file to a custom directory (e.g., test-save_all_plots.R writes to tests/testthat/test-save_all_plots/figures). This is more extensible, but requires adding functionality to export_kqs that allows for writing those files to custom directories rather than getwd().

I have a tested/verified version of option 2 here: https://github.com/JZahner1/stockplotr/tree/test-race-conditions

Originally posted by @JZahner1 in https://github.com/nmfs-ost/stockplotr/issues/433#issuecomment-6369873897

主要言語
R
スター
20
フォーク
10
平均マージ
4日 48分
マージ済み PR(30日)
25

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

nmfs-ost/stockplotr のほかの issue

nmfs-ost/stockplotr の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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