Permalink
Browse files

Include remaining effort in runaway warning.

  • Loading branch information...
1 parent fa46445 commit dde4745a80278862724fb5b67c085ed60f0cbf70 @scrapper scrapper committed Jun 23, 2013
Showing with 31 additions and 6 deletions.
  1. +11 −6 lib/taskjuggler/TaskScenario.rb
  2. +20 −0 test/TestSuite/Scheduler/Errors/sched_runaway.tjp
@@ -1352,7 +1352,6 @@ def query_effortdone(query)
query.string = query.scaleLoad(effort)
end
-
# The remaining (as of 'now') effort allocated for the task in the
# specified interval. In case a Resource is given as scope property only
# the effort allocated for this resource is taken into account.
@@ -2194,16 +2193,22 @@ def hasStrongDeps?(atEnd)
def markAsRunaway
@isRunAway = true
- warning('runaway', "Task #{@property.fullId} does not fit into " +
- "the project time frame. ")
+ remainingEffort =
+ @project.convertToDailyLoad(@project['scheduleGranularity'] *
+ (@effort - @doneEffort))
+ warning('runaway', "#{remainingEffort}d of effort of task " +
+ "#{@property.fullId} " +
+ "does not fit into the project time frame. ")
unless @competitors.empty?
+ multi = @competitors.length > 1
info('runaway_tasks',
- "The following task#{@competitors.length > 1 ? 's' : ''} " +
- "compete for the same resources that this task is requesting: ")
+ "The following task#{multi ? 's' : ''} " +
+ "compete#{multi ? '' : 's'} for the same resources that " +
+ "this task is requesting: ")
@competitors.each do |t|
res = @contendedResources[t].to_a
res.sort! { |i, j| j[1] <=> i[1] }
- resList = res.map { |r| "#{r[0].id}:#{r[1]}" }.join(', ')
+ resList = res.map { |r| "#{r[0].id}(#{r[1]})" }.join(', ')
info('runaway_competitor',
"Task #{t.fullId} has conflicts for the following " +
"resource#{res.length > 1 ? 's' : ''}: #{resList}",
@@ -0,0 +1,20 @@
+project "Runaway" 2013-06-23 +3w
+
+resource r "R"
+
+# MARK: warning 11 runaway
+# MARK: info 11 runaway_tasks
+# MARK: info 17 runaway_competitor
+# MARK: warning 11 unscheduled_tasks
+# MARK: warning 11 unscheduled_task
+# MARK: error 11 sched_runaway
+task "T low" {
+ effort 15d
+ priority 1
+ allocate r
+}
+
+task "T high" {
+ effort 10d
+ allocate r
+}

0 comments on commit dde4745

Please sign in to comment.