diff --git a/packages/compiler-cli/ngcc/src/locking/async_locker.ts b/packages/compiler-cli/ngcc/src/locking/async_locker.ts index f0ee1b7393..36a8c8faf5 100644 --- a/packages/compiler-cli/ngcc/src/locking/async_locker.ts +++ b/packages/compiler-cli/ngcc/src/locking/async_locker.ts @@ -52,7 +52,9 @@ export class AsyncLocker { if (attempts === 0) { this.logger.info( `Another process, with id ${pid}, is currently running ngcc.\n` + - `Waiting up to ${this.retryDelay * this.retryAttempts / 1000}s for it to finish.`); + `Waiting up to ${this.retryDelay * this.retryAttempts / 1000}s for it to finish.\n` + + `(If you are sure no ngcc process is running then you should delete the lock-file at ${ + this.lockFile.path}.)`); } // The file is still locked by another process so wait for a bit and retry await new Promise(resolve => setTimeout(resolve, this.retryDelay)); diff --git a/packages/compiler-cli/ngcc/test/locking/async_locker_spec.ts b/packages/compiler-cli/ngcc/test/locking/async_locker_spec.ts index a77b34c5d8..9f359b37d8 100644 --- a/packages/compiler-cli/ngcc/test/locking/async_locker_spec.ts +++ b/packages/compiler-cli/ngcc/test/locking/async_locker_spec.ts @@ -76,7 +76,9 @@ runInEachFileSystem(() => { // The lock is now waiting on the lock-file becoming free, so no `fn()` in the log. expect(log).toEqual(['write()', 'read() => 188']); expect(logger.logs.info).toEqual([[ - 'Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.' + 'Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.\n' + + `(If you are sure no ngcc process is running then you should delete the lock-file at ${ + lockFile.path}.)` ]]); lockFileContents = null; @@ -112,7 +114,9 @@ runInEachFileSystem(() => { // The lock is now waiting on the lock-file becoming free, so no `fn()` in the log. expect(log).toEqual(['write()', 'read() => 188']); expect(logger.logs.info).toEqual([[ - 'Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.' + 'Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.\n' + + `(If you are sure no ngcc process is running then you should delete the lock-file at ${ + lockFile.path}.)` ]]); lockFileContents = '444'; @@ -120,12 +124,12 @@ runInEachFileSystem(() => { await new Promise(resolve => setTimeout(resolve, 250)); expect(log).toEqual(['write()', 'read() => 188', 'write()', 'read() => 444']); expect(logger.logs.info).toEqual([ - [ - 'Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.' - ], - [ - 'Another process, with id 444, is currently running ngcc.\nWaiting up to 1s for it to finish.' - ] + ['Another process, with id 188, is currently running ngcc.\nWaiting up to 1s for it to finish.\n' + + `(If you are sure no ngcc process is running then you should delete the lock-file at ${ + lockFile.path}.)`], + ['Another process, with id 444, is currently running ngcc.\nWaiting up to 1s for it to finish.\n' + + `(If you are sure no ngcc process is running then you should delete the lock-file at ${ + lockFile.path}.)`] ]); lockFileContents = null;