From patchwork Thu Oct 10 12:20:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1995426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L5CnQjsJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XPTPH0zh4z1xsv for ; Thu, 10 Oct 2024 23:20:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CC82660B0B; Thu, 10 Oct 2024 12:20:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id hRtvWIIMOvqI; Thu, 10 Oct 2024 12:20:47 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C8BC8605C9 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L5CnQjsJ Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id C8BC8605C9; Thu, 10 Oct 2024 12:20:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5BED3C08A6; Thu, 10 Oct 2024 12:20:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 620DDC08A3 for ; Thu, 10 Oct 2024 12:20:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 440B060B09 for ; Thu, 10 Oct 2024 12:20:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UWY-6mazaNuh for ; Thu, 10 Oct 2024 12:20:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 5A82B605C9 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5A82B605C9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5A82B605C9 for ; Thu, 10 Oct 2024 12:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728562843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsdxeC+J989EvFO7CsnET44hMUXkYryrlmk7bFnFIOY=; b=L5CnQjsJFqddC7tIZVRJg9DRCDEFcQajE4TrgCmGAptMq2+Whvu98suzBhbZKog4dfYAAX G3UwuHt8Z4VXQ9DfbxQkUfAZfnI5JlNkhokdP+x7Rc7M8zZdVx2uLOuS8H8dsSd++J33JN NDd2VtCEXF66TLhpZ4Ajv2kfSiGying= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-278-6rzCLmZgMwyaKxeLsHzDuQ-1; Thu, 10 Oct 2024 08:20:42 -0400 X-MC-Unique: 6rzCLmZgMwyaKxeLsHzDuQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8562B19560AE for ; Thu, 10 Oct 2024 12:20:41 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.226.117]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 51C9D19560A3; Thu, 10 Oct 2024 12:20:40 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Thu, 10 Oct 2024 14:20:38 +0200 Message-ID: <20241010122038.1083809-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ci: Add timeout command to test execution. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dceara@redhat.com Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The timeout command allows us to specify a timeout for each job in CI. This is handy because there might be a test that is not able to finish fro various reasons, last time it was forking nc process. At the same time having timeout over the make command allows us to preserve artifacts even if the timeout is reached so it might be easier to debug what is happening. Signed-off-by: Ales Musil --- .ci/ci.sh | 12 +++++++++--- .ci/linux-build.sh | 9 ++++++--- .github/workflows/test.yml | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.ci/ci.sh b/.ci/ci.sh index f543967dc..13df3db34 100755 --- a/.ci/ci.sh +++ b/.ci/ci.sh @@ -20,6 +20,7 @@ CONTAINER_CMD=${CONTAINER_CMD:-podman} CONTAINER_WORKSPACE="/workspace" CONTAINER_WORKDIR="/workspace/ovn-tmp" IMAGE_NAME=${IMAGE_NAME:-"ovn-org/ovn-tests"} +TIMEOUT=${TIMEOUT:-"0"} # Test variables ARCH=${ARCH:-$(uname -m)} @@ -100,7 +101,8 @@ function run_tests() { && \ ARCH=$ARCH CC=$CC LIBS=$LIBS OPTS=$OPTS TESTSUITE=$TESTSUITE \ TEST_RANGE=$TEST_RANGE SANITIZERS=$SANITIZERS DPDK=$DPDK \ - RECHECK=$RECHECK UNSTABLE=$UNSTABLE ./.ci/linux-build.sh + RECHECK=$RECHECK UNSTABLE=$UNSTABLE TIMEOUT=$TIMEOUT \ + ./.ci/linux-build.sh " } @@ -115,7 +117,7 @@ function check_clang_version_ge() { } options=$(getopt --options "" \ - --long help,shell,archive-logs,jobs:,ovn-path:,ovs-path:,image-name:\ + --long help,shell,archive-logs,jobs:,ovn-path:,ovs-path:,image-name:,timeout:\ -- "${@}") eval set -- "$options" while true; do @@ -142,11 +144,15 @@ while true; do --archive-logs) archive_logs="1" ;; + --timeout) + shift + TIMEOUT="$1" + ;; --help) set +x printf "$0 [--shell] [--help] [--archive-logs] [--jobs=] " printf "[--ovn-path=] [--ovs-path=] " - printf "[--image-name=]\n" + printf "[--image-name=] [--timeout=]\n" exit ;; --) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 75a9480f9..7740f7a3f 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -10,6 +10,7 @@ OVN_CFLAGS="" OPTS="$OPTS --enable-Werror" JOBS=${JOBS:-"-j4"} RECHECK=${RECHECK:-"no"} +TIMEOUT=${TIMEOUT:="0"} function install_dpdk() { @@ -105,7 +106,8 @@ function configure_clang() function run_tests() { - if ! make distcheck CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $JOBS \ + if ! timeout $TIMEOUT make distcheck \ + CFLAGS="${COMMON_CFLAGS} ${OVN_CFLAGS}" $JOBS \ TESTSUITEFLAGS="$JOBS $TEST_RANGE" RECHECK=$RECHECK \ SKIP_UNSTABLE=$SKIP_UNSTABLE then @@ -147,8 +149,9 @@ function run_system_tests() local type=$1 local log_file=$2 - if ! sudo make $JOBS $type TESTSUITEFLAGS="$TEST_RANGE" \ - RECHECK=$RECHECK SKIP_UNSTABLE=$SKIP_UNSTABLE; then + if ! sudo timeout $TIMEOUT make $JOBS $type \ + TESTSUITEFLAGS="$TEST_RANGE" RECHECK=$RECHECK \ + SKIP_UNSTABLE=$SKIP_UNSTABLE; then # $log_file is necessary for debugging. cat tests/$log_file return 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7a184c13..47085c4fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -168,11 +168,11 @@ jobs: - name: build if: ${{ startsWith(matrix.cfg.testsuite, 'system-test') }} - run: sudo -E ./.ci/ci.sh --archive-logs + run: sudo -E ./.ci/ci.sh --archive-logs --timeout=1h - name: build if: ${{ !startsWith(matrix.cfg.testsuite, 'system-test') }} - run: ./.ci/ci.sh --archive-logs + run: ./.ci/ci.sh --archive-logs --timeout=1h - name: upload logs on failure if: failure() || cancelled()