Interactions between Lolex, Timecop and the Cache in HyperSpec
まだ誰も着手していません。
評価
調査の方向性
まず HyperSpec::Internal::Controller の cache_read、cache_write、cache_delete メソッドを見つけ、次に Lolex.evaluate_ruby と、そこで Filecache と Timecop がどのように相互作用するかを調べます。完了条件は、キャッシュ操作がシステム時刻を使用し、HyperSpec がマウントされていない場合も Lolex の更新が保持され、不要なクライアント通信を送信しないことです。
索引モデルが issue の本文から書いたものです。
説明
Hyperspec uses the Filecache gem, which uses Time.now. But if Timecop freezes time in a spec, then Time.now is not returning the system time, and the Filecache does not work. This should be fixable by wrapping calls to the Filecache with the timecop return method (and a block.) But this does not in general work because Hyperspec tries to communicate the "return" to the client, even if the client is not running.
The following series of patches fixes the issue, and can be incorporated into the next point release:
module HyperSpec
module Internal
module Controller
class << self
# wrap all calls with Timecop.return so the file cache gets the true system time
def cache_read(key)
Timecop.return { file_cache.get(key) }
end
def cache_write(key, value)
Timecop.return { file_cache.set(key, value) }
end
def cache_delete(key)
Timecop.return { file_cache.delete(key) }
rescue StandardError
nil
end
end
end
end
end
class Lolex
# store all lolex updates unless hyper_spec is mounted
def self.evaluate_ruby(&block)
if @capybara_page&.instance_variable_get('@hyper_spec_mounted')
@capybara_page.internal_evaluate_ruby(yield)
else
pending_evaluations << block
end
end
end
- 主要言語
- JavaScript
- スター
- 538
- フォーク
- 41
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hyperstack-org/hyperstack のほかの issue
-
enhancement needs doc
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
hyperstack-org/hyperstack#359 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
hyperstack-org/hyperstack#267 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
hyperstack-org/hyperstack#457 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
hyperstack-org/hyperstack#456 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
hyperstack-org/hyperstack#455 · コメント 2 件 ·
hyperstack-org/hyperstack の issue をすべて見る
似ている issue
-
bug customer-eng Durable Agents Inngest status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
optimization optimization:agents-md-curator
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/OrgExplorer#253 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100