it 'test failing local_to_utc' do
tz = TZInfo::Timezone.get('Europe/Warsaw')
time = Time.parse('2019-01-01T02:30:00Z')
failed = []
10000.times do |day|
24.times do |hour|
new_time = time + day * 60 * 60 * 24 + hour * 60 * 60
tz.local_to_utc(new_time)
rescue => _
failed << new_time.iso8601
end
end
expect(failed).to be_empty
end
We spotted error with one specific time
This leads to error
{TZInfo::PeriodNotFound} 2020-03-29 02:30:00 is an invalid local time.
changing it to any other hour or day seems to work fine
here Ruby 2.5.5 (but is the same for 2.5.7)
The text was updated successfully, but these errors were encountered: