[MTR] Start using '--port-base' option instead of MTR_BUILD_THREAD

Explanation of the options per:
https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN_PL.html

--port-base=P
  The value may also be given with the environment variable MTR_PORT_BASE.

  The variable MTR_PORT_BASE is a more logical replacement for the original variable MTR_BUILD_THREAD.
  It gives the actual port number directly (will be rounded down to a multiple of 10).
  If you use MTR_BUILD_THREAD, the port number is found by multiplying this by 10 and adding 10000.

  Specify base of port numbers to be used; a block of 10 will be allocated. P should be divisible by 10;
  if it is not, it will be rounded down. If running with more than one parallel test thread, thread 2
  will use the next block of 10 and so on.

  If the port number is given as auto, which is also the default,
  mysql-test-run.pl will allocate a number unique to this host.

  --port-base was added as a more logical alternative to --build-thread.
  If both are used, --port-base takes precedence.
This commit is contained in:
Michal Schorm 2024-08-15 01:36:53 +02:00
parent 9a8f94a4f3
commit badd81d2d5

View File

@ -761,18 +761,13 @@ pushd %_vpath_builddir
pushd mysql-test
cp ../../mysql-test/%{skiplist} .
# Builds might happen at the same host, avoid collision
# The port used is calculated as 10 * MTR_BUILD_THREAD + 10000
# The resulting port must be between 5000 and 32767
export MTR_BUILD_THREAD=$(( $(date +%s) % 2200 ))
(
set -ex
cd %{buildroot}%{_datadir}/mysql-test
export common_testsuite_arguments=" %{?with_debug:--debug-server} \
--force --skip-combinations --report-unstable-tests --clean-vardir --nocheck-testcases \
--suite-timeout=900 --testcase-timeout=30 \
--suite-timeout=900 --testcase-timeout=30 --port-base=$(( $(date +%s) % 20000 + 10000 )) \
--parallel=auto --retry=3 --max-test-fail=30 "
# If full testsuite has already been run on this version and we don't explicitly want the full testsuite to be run