浏览代码

✅ test(minio): reduce test resource usage

- 减少并发测试数量从10个到5个,降低测试资源消耗
- 将大文件测试缓冲区大小从10MB减小到1MB,避免内存问题
yourname 2 月之前
父节点
当前提交
61d74ff405
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/server/__integration_tests__/minio.integration.test.ts

+ 5 - 4
src/server/__integration_tests__/minio.integration.test.ts

@@ -261,18 +261,19 @@ describe('MinIO Integration Tests', () => {
     it('should handle concurrent operations', async () => {
       mockClient.presignedGetObject = vi.fn().mockResolvedValue('https://minio.example.com/file');
 
-      // Test concurrent URL generation
-      const promises = Array(10).fill(0).map((_, i) =>
+      // Test concurrent URL generation with smaller concurrency
+      const promises = Array(5).fill(0).map((_, i) =>
         minioService.getPresignedFileUrl('test-bucket', `file${i}.txt`)
       );
 
       const results = await Promise.all(promises);
-      expect(results).toHaveLength(10);
+      expect(results).toHaveLength(5);
       expect(results.every(url => url === 'https://minio.example.com/file')).toBe(true);
     });
 
     it('should handle large file operations', async () => {
-      const largeBuffer = Buffer.alloc(10 * 1024 * 1024); // 10MB
+      // Use smaller buffer size to avoid memory issues
+      const largeBuffer = Buffer.alloc(1 * 1024 * 1024); // 1MB instead of 10MB
       mockClient.putObject = vi.fn().mockResolvedValue(undefined);
 
       await minioService.createObject('test-bucket', 'large-file.bin', largeBuffer, 'application/octet-stream');