Skip to content

Commit ab3bd0a

Browse files
committed
fix: minor tweaks for message consistency and stability
Signed-off-by: Nathan Klick <[email protected]>
1 parent 417b5f6 commit ab3bd0a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/core/listr_lease.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ListrLease {
6060
task.title = `${title} - ${chalk.gray(`lease exists, attempting again in ${lease.DurationSeconds} seconds`)}` +
6161
`, attempt: ${chalk.cyan((attempt + 1).toString())}/${chalk.cyan(maxAttempts.toString())}`
6262

63-
if (attempt === maxAttempts - 1) {
63+
if (attempt >= maxAttempts) {
6464
innerError = e
6565
}
6666
}
@@ -69,6 +69,6 @@ export class ListrLease {
6969
task.title = `${title} - ${chalk.red('failed to acquire lease, max attempts reached!')}` +
7070
`, attempt: ${chalk.cyan(attempt.toString())}/${chalk.cyan(maxAttempts.toString())}`
7171

72-
throw new LeaseAcquisitionError(`Failed to acquire lease, max attempts reached (${attempt}/${maxAttempts})`, innerError)
72+
throw new LeaseAcquisitionError(`Failed to acquire lease, max attempts reached (${attempt + 1}/${maxAttempts})`, innerError)
7373
}
7474
}

test/e2e/integration/core/lease.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Lease', async function () {
4141
this.timeout(defaultTimeout)
4242
if (await k8.hasNamespace(testNamespace)) {
4343
await k8.deleteNamespace(testNamespace)
44-
await sleep(500)
44+
await sleep(5 * SECONDS)
4545
}
4646

4747
await k8.createNamespace(testNamespace)

test/e2e/integration/core/lease_renewal.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('LeaseRenewalService', async function () {
4141
this.timeout(defaultTimeout)
4242
if (await k8.hasNamespace(testNamespace)) {
4343
await k8.deleteNamespace(testNamespace)
44-
await sleep(500)
44+
await sleep(5 * SECONDS)
4545
}
4646

4747
await k8.createNamespace(testNamespace)

0 commit comments

Comments
 (0)