[ServiceBus][test] log more diagnostic information (#20986)

* log more information to help diagnose test failure in issue #20963.

* Update sdk/servicebus/service-bus/test/internal/unit/receiverCommon.spec.ts

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
This commit is contained in:
Jeremy Meng 2022-03-23 10:27:09 -07:00 коммит произвёл GitHub
Родитель 69aa3f9726
Коммит f58ac8ae6f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -323,9 +323,13 @@ describe("shared receiver code", () => {
if (numRetryCalls > 1) {
// not the first attempt
const currentTime = Date.now();
if (currentTime - previousAttemptTime < retryDelayInMs) {
const elapsed = currentTime - previousAttemptTime;
console.log(
`### ${elapsed} ms passed (from ${previousAttemptTime} to ${currentTime})`
);
if (elapsed < retryDelayInMs) {
errorMessages.push(
`Unexpected, Should've waited at least ${retryDelayInMs} between attempts`
`Elapsed time ${elapsed} ms (from ${previousAttemptTime} to ${currentTime}) is shorter than expected, the wait between attempts should have been at least ${retryDelayInMs} ms.`
);
}
previousAttemptTime = currentTime;