Commit ad1f2da1 authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[Jobs API]: Make concurrency check error message more verbose.

Log actual values of max_concurrency, expected_max_concurrency and should yield.

Change-Id: I4151e8812d58c30311111d07d06844d2f4ce60e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303986
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789658}
parent eeb2d080
...@@ -99,10 +99,13 @@ void JobDelegate::AssertExpectedConcurrency(size_t expected_max_concurrency) { ...@@ -99,10 +99,13 @@ void JobDelegate::AssertExpectedConcurrency(size_t expected_max_concurrency) {
// Case 2b: // Case 2b:
const bool updated = task_source_->WaitForConcurrencyIncreaseUpdate( const bool updated = task_source_->WaitForConcurrencyIncreaseUpdate(
recorded_increase_version_); recorded_increase_version_);
DCHECK(updated || const size_t max_concurrency = task_source_->GetMaxConcurrency();
task_source_->GetMaxConcurrency() <= expected_max_concurrency) DCHECK(updated || max_concurrency <= expected_max_concurrency)
<< "Value returned by |max_concurrency_callback| is expected to " << "Value returned by |max_concurrency_callback| (" << max_concurrency
"decrease, unless NotifyConcurrencyIncrease() is called."; << ") is expected to decrease below or equal to "
<< expected_max_concurrency
<< ", unless NotifyConcurrencyIncrease() is called."
<< "Last ShouldYield() returned " << last_should_yield_;
recorded_increase_version_ = task_source_->GetConcurrencyIncreaseVersion(); recorded_increase_version_ = task_source_->GetConcurrencyIncreaseVersion();
recorded_max_concurrency_ = task_source_->GetMaxConcurrency(); recorded_max_concurrency_ = task_source_->GetMaxConcurrency();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment