test/test_BatchProcessor.rb in taskjuggler-3.7.1 vs test/test_BatchProcessor.rb in taskjuggler-3.7.2
- old
+ new
@@ -30,10 +30,14 @@
def teardown
@t.kill
end
+ def test_basic
+ doRun(1, 1) { sleep 0.1 }
+ end
+
def test_simple
doRun(1, 1) { sleep 0.1 }
doRun(1, 2) { sleep 0.1 }
doRun(1, 7) { sleep 0.1 }
doRun(2, 1) { sleep 0.1 }
@@ -61,11 +65,10 @@
bp.queue("job #{i}") { runJob(i, &block) }
end
@cnt = 0
lock = Monitor.new
bp.wait do |j|
- puts "Signal error" if j.retVal.signaled?
postprocess(j)
lock.synchronize { @cnt += 1 }
end
assert_equal(jobs, @cnt, "Not all threads terminated propertly (#{@cnt})")
end
@@ -73,15 +76,15 @@
def runJob(n, &block)
puts "Job #{n} started"
yield
$stderr.puts "Error #{n}" if n % 2 == 0
puts "Job #{n} finished"
+ # Return the job ID as return value
n
end
def postprocess(job)
- assert_equal(job.retVal.exitstatus, job.jobId, 'JobID mismatch')
- assert_equal(job.retVal.pid, job.pid, 'PID mismatch')
+ assert_equal(job.retVal, job.jobId, 'PID mismatch')
assert_equal("job #{job.jobId}", job.tag)
text = <<"EOT"
Job #{job.jobId} started
Job #{job.jobId} finished
EOT