Skip to content
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

Don't raise an error for now, if a reposync.log is not processed correctly #9462

Merged
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
24 changes: 14 additions & 10 deletions testsuite/features/support/system_monitoring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ def product_synchronization_duration(os_product_version)
duration = 0
channel_to_evaluate = false
matches = 0
File.foreach('/tmp/reposync.log') do |line|
log_content = File.readlines('/tmp/reposync.log')
log_content.each do |line|
if line.include?('Channel: ')
channel_name = line.split('Channel: ')[1].strip
channel_to_evaluate = channels_to_wait.include?(channel_name)
end
if line.include?('Total time: ') && channel_to_evaluate
match = line.match(/Total time: (\d+):(\d+):(\d+)/)
hours, minutes, seconds = match.captures.map(&:to_i)
total_seconds = (hours * 3600) + (minutes * 60) + seconds
duration += total_seconds
matches += 1
channel_to_evaluate = false
end
next unless line.include?('Total time: ') && channel_to_evaluate

match = line.match(/Total time: (\d+):(\d+):(\d+)/)
hours, minutes, seconds = match.captures.map(&:to_i)
total_seconds = (hours * 3600) + (minutes * 60) + seconds
duration += total_seconds
matches += 1
channel_to_evaluate = false
end

raise ScriptError, "Error extracting the synchronization duration of #{os_product_version}" if matches.zero?
if matches < channels_to_wait.size
$stdout.puts("Error extracting the synchronization duration of #{os_product_version}")
$stdout.puts("Content of reposync.log:\n#{log_content.join}")
end

duration
end
Expand Down
Loading