Skip to content

Commit

Permalink
FIX stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Dec 10, 2024
1 parent 5e06851 commit eb72d2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
9 changes: 6 additions & 3 deletions test/performance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import {
createRxDatabase,
randomToken,
overwritable,
requestIdlePromise
requestIdlePromise,
RxCollection
} from '../plugins/core/index.mjs';
import * as assert from 'assert';
import {
schemaObjects,
schemas,
isFastMode,
isDeno
isDeno,
AverageSchemaDocumentType
} from '../plugins/test-utils/index.mjs';
import config from './unit/config.ts';
import { wait } from 'async-test-util';
Expand Down Expand Up @@ -71,6 +73,7 @@ describe('performance.test.ts', () => {
// create database
const dbName = 'test-db-performance-' + randomToken(10);
const schema = schemas.averageSchema();
let collection: RxCollection<AverageSchemaDocumentType>;
async function createDbWithCollections() {
if (collection) {
await collection.database.close();
Expand Down Expand Up @@ -112,7 +115,7 @@ describe('performance.test.ts', () => {
await collections[collectionNames[1]].insert(schemaObjects.averageSchemaData());
return collections[firstCollectionName];
}
let collection = await createDbWithCollections();
collection = await createDbWithCollections();
updateTime('time-to-first-insert');
await awaitBetweenTest();

Expand Down
6 changes: 0 additions & 6 deletions test/unit/attachments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ describeParallel('attachments.test.ts', () => {
let x = 10;
const attachmentIds: string[] = [];
const promises: Promise<any>[] = [];
console.log('######################################');
console.log('######################################');
console.log('######################################');
while (x > 0) {
x--;
if (randomBoolean()) {
Expand All @@ -330,7 +327,6 @@ describeParallel('attachments.test.ts', () => {
type: 'text/plain'
}).then((attachment) => {
attachment.getStringData();
console.log('stored: ' + id);
attachmentIds.push(id);
})
);
Expand All @@ -343,10 +339,8 @@ describeParallel('attachments.test.ts', () => {
if (!id) {
await promiseWait(10);
} else {
console.log('start read: ' + id);
const attachment = doc.getLatest().getAttachment(id);
await ensureNotFalsy(attachment, 'missing attachment ' + id).getData();
console.log('got');
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function getStorage(storageKey: string): RxTestStorage {
};
},
hasPersistence: true,
hasMultiInstance: false,
hasMultiInstance: true,
hasAttachments: true,
hasReplication: true
};
Expand Down

0 comments on commit eb72d2a

Please sign in to comment.