mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-25 09:02:23 +00:00
DEV: Patch Net::BufferedIO
to help debug spec flakes (#1375)
Internal `/t/154170`
This commit is contained in:
parent
39653aed22
commit
ca78b1a1c5
@ -1,5 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Debugging https://github.com/ruby/net-protocol/issues/32
|
||||
# which seems to be happening inconsistently in CI
|
||||
Net::BufferedIO.prepend(
|
||||
Module.new do
|
||||
def initialize(*args, **kwargs)
|
||||
if kwargs[:debug_output] && !kwargs[:debug_output].respond_to(:<<)
|
||||
raise ArgumentError, "debug_output must support <<"
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
def debug_output=(debug_output)
|
||||
if debug_output && !debug_output.respond_to?(:<<)
|
||||
raise ArgumentError, "debug_output must support <<"
|
||||
end
|
||||
super
|
||||
end
|
||||
end,
|
||||
)
|
||||
|
||||
describe DiscourseAi::Completions::CancelManager do
|
||||
fab!(:model) { Fabricate(:anthropic_model, name: "test-model") }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user