(core) port some more test/browser tests to newer selenium

Summary:
Ports more test/browser tests from *.test.js (run using an old selenium setup) to *.ntest.js (run using newer setup).

Weird test failures happened due to a change in timing. Eventually tracked in down to billing changes in one test suite resulting in reloads in another test suite, since it turns out redis pub/sub channels are not scoped to the redis database specified in REDIS_URL, but are global:
  https://redis.io/docs/manual/pubsub/#database--scoping.

Test Plan: Ported tests should run and pass

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3844
This commit is contained in:
Paul Fitzpatrick
2023-04-12 12:18:48 -04:00
parent 900859854c
commit cc0e1154d0
5 changed files with 44 additions and 6 deletions

View File

@@ -235,6 +235,7 @@ export class DocManager extends EventEmitter {
if (docPromise) {
// Call activeDoc's shutdown method first, to remove the doc from internal structures.
const doc: ActiveDoc = await docPromise;
log.debug('DocManager.deleteDoc starting activeDoc shutdown', docName);
await doc.shutdown();
}
await this.storageManager.deleteDoc(docName, deletePermanently);
@@ -368,8 +369,12 @@ export class DocManager extends EventEmitter {
* Shut down all open docs. This is called, in particular, on server shutdown.
*/
public async shutdownAll() {
await Promise.all(Array.from(this._activeDocs.values(),
adocPromise => adocPromise.then(adoc => adoc.shutdown())));
await Promise.all(Array.from(
this._activeDocs.values(),
adocPromise => adocPromise.then(async adoc => {
log.debug('DocManager.shutdownAll starting activeDoc shutdown', adoc.docName);
await adoc.shutdown();
})));
try {
await this.storageManager.closeStorage();
} catch (err) {
@@ -471,6 +476,7 @@ export class DocManager extends EventEmitter {
if (activeDoc && activeDoc.recoveryMode !== wantRecoveryMode && await activeDoc.isOwner(docSession)) {
// shutting doc down to have a chance to re-open in the correct mode.
// TODO: there could be a battle with other users opening it in a different mode.
log.debug('DocManager._fetchPossiblyMutedDoc starting activeDoc shutdown', docName);
await activeDoc.shutdown();
}
}