diff options
-rw-r--r-- | lib/chef/resource.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index 6adf937f53..84d6a2fca6 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -660,6 +660,9 @@ F end ensure @elapsed_time = Time.now - start_time + # Reporting endpoint doesn't accept a negative resource duration so set it to 0. + # A negative value can occur when a resource changes the system time backwards + @elapsed_time = 0 if @elapsed_time < 0 events.resource_completed(self) end end |