diff --git a/overlord/snapstate/snapstate_test.go b/overlord/snapstate/snapstate_test.go index 68a94355398..2cd2499edbb 100644 --- a/overlord/snapstate/snapstate_test.go +++ b/overlord/snapstate/snapstate_test.go @@ -101,7 +101,7 @@ func (s *snapmgrBaseTest) settle(c *C) { s.state.Unlock() defer s.state.Lock() - err := s.o.Settle(testutil.HostScaledTimeout(5 * time.Second)) + err := s.o.Settle(testutil.HostScaledTimeout(10 * time.Second)) if err != nil { s.state.Lock() defer s.state.Unlock() diff --git a/run-checks b/run-checks index 9813226dbf3..66dc1a4e8f3 100755 --- a/run-checks +++ b/run-checks @@ -12,6 +12,7 @@ COVERMODE=${COVERMODE:-atomic} COVERAGE_SUFFIX=${GO_BUILD_TAGS:-notags} COVERAGE_OUT=${COVERAGE_OUT:-.coverage/coverage-$COVERAGE_SUFFIX.cov} CHANGED_FILES=${CHANGED_FILES:-""} +TIMEOUT=${TIMEOUT:-5} if [ -z "${GITHUB_WORKFLOW:-}" ]; then # when *not* running inside github, ensure we use go-1.18 by default @@ -434,7 +435,7 @@ if [ "$UNIT" = 1 ]; then tags= race= - timeout="5m" + timeout="${TIMEOUT}m" if [ -n "${GO_BUILD_TAGS:-}" ]; then echo "Using build tags: $GO_BUILD_TAGS" tags="-tags $GO_BUILD_TAGS" @@ -442,7 +443,7 @@ if [ "$UNIT" = 1 ]; then if [ -n "${GO_TEST_RACE:-}" ]; then echo "Using go test -race" race="-race" - timeout="10m" + timeout="$((TIMEOUT*2))m" fi echo Building diff --git a/tests/unit/go/task.yaml b/tests/unit/go/task.yaml index 0d8b731640b..8b7c8f73d20 100644 --- a/tests/unit/go/task.yaml +++ b/tests/unit/go/task.yaml @@ -84,6 +84,7 @@ execute: | $PROXY_PARAM \ SKIP_COVERAGE=1 \ CC=$VARIANT \ + TIMEOUT=15 \ ./run-checks --unit" fi else @@ -119,6 +120,7 @@ execute: | $PROXY_PARAM \ SKIP_COVERAGE=1 \ CC=$VARIANT \ + TIMEOUT=15 \ ./run-checks --unit" test fi fi