From 49a455b752251915f1916094155874029716288f Mon Sep 17 00:00:00 2001 From: Christophe Diederichs Date: Thu, 4 Apr 2024 14:30:26 +0100 Subject: [PATCH] add more logs --- index.js | 7 +++++++ test/flake.js | 2 ++ 2 files changed, 9 insertions(+) diff --git a/index.js b/index.js index e0ba496a..104c442b 100644 --- a/index.js +++ b/index.js @@ -359,20 +359,27 @@ module.exports = class Autobase extends ReadyResource { } async _close () { + if (this.debug) console.log('awaiting promise...') await Promise.resolve() // defer one tick const closing = this._advancing.catch(safetyCatch) + if (this.debug) console.log('awaiting ack timer closing...') if (this._ackTimer) { this._ackTimer.stop() await this._ackTimer.flush() } + if (this.debug) console.log('awaiting wakeup closing...') await this._wakeup.close() + if (this.debug) console.log('awaiting handlers closing...') if (this._hasClose) await this._handlers.close(this.view) + if (this.debug) console.log('awaiting primary closing...') if (this._primaryBootstrap) await this._primaryBootstrap.close() + if (this.debug) console.log('awaiting store closing...') await this.store.close() + if (this.debug) console.log('awaiting closing...') await closing } diff --git a/test/flake.js b/test/flake.js index c46f58d9..67f752c0 100644 --- a/test/flake.js +++ b/test/flake.js @@ -60,7 +60,9 @@ for (let i = 0; i < 1000; i++) { apply: applyOldState }) + b2.debug = true await b2.ready() + console.log('READY') await t.execution(b2.ready()) async function applyOldState (batch, view, base) {