From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 392731582EF for ; Mon, 10 Mar 2025 00:20:16 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 24966343133 for ; Mon, 10 Mar 2025 00:20:16 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 659E211037D; Mon, 10 Mar 2025 00:20:12 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 5C34511037D for ; Mon, 10 Mar 2025 00:20:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 19CE234301D for ; Mon, 10 Mar 2025 00:20:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 73A062863 for ; Mon, 10 Mar 2025 00:20:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1741565953.301cd23e23a7bc7961bbba29733bb488f914c30b.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mysql/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-db/mysql/mysql-8.0.40.ebuild X-VCS-Directories: dev-db/mysql/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 301cd23e23a7bc7961bbba29733bb488f914c30b X-VCS-Branch: master Date: Mon, 10 Mar 2025 00:20:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 463337e2-47d6-44d5-8e82-0fb806c44601 X-Archives-Hash: 6ca6c915304037888dd05967aa0cf80b commit: 301cd23e23a7bc7961bbba29733bb488f914c30b Author: Alfred Wingate protonmail com> AuthorDate: Sun Mar 9 09:19:33 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 10 00:19:13 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=301cd23e dev-db/mysql: use tmpfs for test databases opportunistically Use max parallelisation if possible otherwise use one job to avoid failures from high I/O contention. Signed-off-by: Alfred Wingate protonmail.com> Signed-off-by: Sam James gentoo.org> dev-db/mysql/mysql-8.0.40.ebuild | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dev-db/mysql/mysql-8.0.40.ebuild b/dev-db/mysql/mysql-8.0.40.ebuild index 6a97a5f62cc4..7138143ad509 100644 --- a/dev-db/mysql/mysql-8.0.40.ebuild +++ b/dev-db/mysql/mysql-8.0.40.ebuild @@ -399,7 +399,17 @@ src_test() { # Ensure that parallel runs don't die local -x MTR_BUILD_THREAD="$((${RANDOM} % 100))" - local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)} + # Use a tmpfs opportunistically, otherwise set MTR_PARALLEL to 1. + # MySQL tests are I/O heavy. They benefit greatly from a tmpfs, parallel tests without a tmpfs are flaky due to timeouts. + if mountpoint -q /dev/shm ; then + local VARDIR="/dev/shm/mysql-var-${MTR_BUILD_THREAD}" + local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)} + else + ewarn "/dev/shm not mounted, setting default MTR_PARALLEL to 1. Tests will take a long time" + local VARDIR="${T}/vardir" + # Set it to one while allowing users to override it. + local -x MTR_PARALLEL=${MTR_PARALLEL:-1} + fi einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'" # Disable unit tests, run them separately with eclass defaults @@ -576,11 +586,18 @@ src_test() { # Anything touching gtid_executed is negatively affected if you have unlucky ordering nonfatal edo perl mysql-test-run.pl \ --force --force-restart \ - --vardir="${T}/var-tests" --tmpdir="${T}/tmp-tests" \ + --vardir="${VARDIR}" --tmpdir="${T}/tmp-tests" \ --skip-test=tokudb --skip-test-list="${T}/disabled.def" \ --retry-failure=2 --max-test-fail=0 retstatus_tests=$? + if [[ "${VARDIR}" != "${T}/var-tests" ]]; then + # Move vardir to tempdir. + mv "${VARDIR}" "${T}/var-tests" + # Clean up mysql temporary directory + rm -rf "${VARDIR}" 2>/dev/null + fi + popd &>/dev/null || die # Cleanup is important for these testcases.