Skip to content

Commit

Permalink
Don't raise an error for now, if a reposync.log is not processed corr…
Browse files Browse the repository at this point in the history
…ectly
  • Loading branch information
srbarrios committed Nov 14, 2024
1 parent ef605e3 commit 8141c6b
Showing 1 changed file with 14 additions and 10 deletions.
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

0 comments on commit 8141c6b

Please sign in to comment.