mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 04:12:16 +01:00
refactoring process management: no more orphan processes and quicker chrome startup
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/thecodingmachine/gotenberg/internal/pkg/xcontext"
|
||||
"github.com/thecodingmachine/gotenberg/test"
|
||||
)
|
||||
|
||||
@@ -37,3 +38,16 @@ func TestCommandContext(t *testing.T) {
|
||||
LogBeforeExecute(logger, cmd)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
logger := test.DebugLogger()
|
||||
// should run without issue.
|
||||
err := Run(context.Background(), logger, "echo", "Hello", "World")
|
||||
assert.Nil(t, err)
|
||||
// should not be OK as context.Context
|
||||
// should timeout.
|
||||
ctx, cancel := xcontext.WithTimeout(logger, 0)
|
||||
defer cancel()
|
||||
err = Run(ctx, logger, "echo", "Hello", "World")
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user