Skip to content

Commit

Permalink
fix(core): Do not set ttl globally in test (no-changelog) (n8n-io#7271)
Browse files Browse the repository at this point in the history
  • Loading branch information
flipswitchingmonkey authored Sep 27, 2023
1 parent cd6e228 commit 6d7fe95
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions packages/cli/test/unit/services/cache.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ describe('cacheService', () => {
});

test('should honour ttl values', async () => {
// set default TTL to 10ms
config.set('cache.memory.ttl', 10);

await cacheService.set('testString', 'test');
await cacheService.set('testString', 'test', 10);
await cacheService.set('testNumber1', 123, 1000);

const store = (await cacheService.getCache())?.store;
Expand All @@ -92,15 +89,6 @@ describe('cacheService', () => {

await expect(store!.ttl('testString')).resolves.toBeLessThanOrEqual(100);
await expect(store!.ttl('testNumber1')).resolves.toBeLessThanOrEqual(1000);

// commented out because it fails on CI sporadically
// await expect(cacheService.get('testString')).resolves.toBe('test');
// await expect(cacheService.get('testNumber1')).resolves.toBe(123);

// await new Promise((resolve) => setTimeout(resolve, 20));

// await expect(cacheService.get('testString')).resolves.toBeUndefined();
// await expect(cacheService.get('testNumber1')).resolves.toBe(123);
});

test('should set and remove values', async () => {
Expand Down

0 comments on commit 6d7fe95

Please sign in to comment.