Skip to content

ruby : ignore "Downloading" output in test_log_suppress #3106

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

Merged
merged 1 commit into from
May 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bindings/ruby/tests/test_whisper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,18 @@ def test_log_suppress
dev = StringIO.new("")
$stderr = dev
Whisper::Context.new("base.en")
assert_empty dev.string

# Filter out any lines starting with "Downloading" or containing only dots.
# The reason for this is that I think the recent migration to Huggingface
# Xet might have changed the downloading behavior. There is now a redirect
# to a different URL, which causes the download to be retried even if the
# file is already downloaded.
# TODO(danbev) Remove this when a proper fix is in place.
filtered_output = dev.string.lines.reject do |line|
line.start_with?("Downloading") || line.strip =~ /^\.+$/
end.join

assert_empty filtered_output, "Expected no output, but got: #{filtered_output.inspect}"
ensure
$stderr = stderr
end
Expand Down
Loading