fix: chromium memory leaks (#705)

This commit is contained in:
Julien Neuhart
2023-10-23 17:52:30 +02:00
committed by GitHub
parent b5a59e4de0
commit 54daac329e
71 changed files with 4248 additions and 51761 deletions

View File

@@ -20,7 +20,7 @@ func TestMultiPDFEngines_Merge(t *testing.T) {
{
name: "nominal behavior",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -31,12 +31,12 @@ func TestMultiPDFEngines_Merge(t *testing.T) {
{
name: "at least one engine does not return an error",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return errors.New("foo")
},
},
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -47,12 +47,12 @@ func TestMultiPDFEngines_Merge(t *testing.T) {
{
name: "all engines return an error",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return errors.New("foo")
},
},
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return errors.New("foo")
},
@@ -64,7 +64,7 @@ func TestMultiPDFEngines_Merge(t *testing.T) {
{
name: "context expired",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
MergeMock: func(ctx context.Context, logger *zap.Logger, inputPaths []string, outputPath string) error {
return nil
},
@@ -105,7 +105,7 @@ func TestMultiPDFEngines_Convert(t *testing.T) {
{
name: "nominal behavior",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return nil
},
@@ -116,12 +116,12 @@ func TestMultiPDFEngines_Convert(t *testing.T) {
{
name: "at least one engine does not return an error",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return errors.New("foo")
},
},
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return nil
},
@@ -132,12 +132,12 @@ func TestMultiPDFEngines_Convert(t *testing.T) {
{
name: "all engines return an error",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return errors.New("foo")
},
},
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return errors.New("foo")
},
@@ -149,7 +149,7 @@ func TestMultiPDFEngines_Convert(t *testing.T) {
{
name: "context expired",
engine: newMultiPDFEngines(
gotenberg.PDFEngineMock{
&gotenberg.PDFEngineMock{
ConvertMock: func(ctx context.Context, logger *zap.Logger, format, inputPath, outputPath string) error {
return nil
},