Skip to content

Commit

Permalink
Use python3 from $PATH instead of absolute paths
Browse files Browse the repository at this point in the history
This allows using Python virtualenv directly. This partially reverts changes in
9d0dda0, but its commit message is not stating
anything about absolute paths.
  • Loading branch information
laurynas-biveinis committed Jun 10, 2024
1 parent d1ae977 commit fa795df
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion mysql-test/include/raft_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/python3
#!/usr/bin/env python3

import os
import sys
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/suite/innodb_stress/include/innodb_stress.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if ($do_checksum)
{
# populate the table and store its checksum before any load.
let $exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$num_records 0 0 $user $master_host $MASTER_MYPORT
$table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 0 0;
exec $exec >> $MYSQL_TMP_DIR/load_generator/errors.log;
Expand Down Expand Up @@ -68,14 +68,14 @@ while ($num_crashes)
if ($use_blob)
{
let $exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$num_records $num_workers $num_transactions $user $master_host $MASTER_MYPORT
$table 1 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks;
}
if (!$use_blob)
{
let $exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after
$num_records $num_workers $num_transactions $user $master_host $MASTER_MYPORT
$table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks;
}
Expand Down Expand Up @@ -106,7 +106,7 @@ $table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_ch
--echo applying fake updates to the slave
let $slave_pid_file = `SELECT @@pid_file`;
let $slave_exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $slave_pid_file $kill_db_after
$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $slave_pid_file $kill_db_after
0 $num_workers $num_transactions $user $master_host $SLAVE_MYPORT
$table 0 $max_rows $MYSQL_TMP_DIR/load_generator_slave 1 $checksum $secondary_index_checks;
exec $slave_exec >> $MYSQL_TMP_DIR/load_generator/errors.log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ drop table if exists t1;
# create the actual table
CREATE TABLE t1 (a INT) ENGINE=rocksdb;

let $exec = /usr/bin/python3 suite/rocksdb/t/rocksdb_concurrent_insert.py root 127.0.0.1 $MASTER_MYPORT test t1 100 4;
let $exec = python3 suite/rocksdb/t/rocksdb_concurrent_insert.py root 127.0.0.1 $MASTER_MYPORT test t1 100 4;
exec $exec;

SELECT COUNT(*) from t1;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/rocksdb/t/partial_index_stress.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CREATE TABLE `link_table` (
KEY `id1_type` (`link_type`, `id1`, `visibility`,`time`,`id2`,`version`,`data`) COMMENT 'cfname=rev:cf_link_id1_type;partial_group_keyparts=2;partial_group_threshold=10'
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;

exec /usr/bin/python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;
exec python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;

DROP TABLE link_table;

Expand All @@ -37,7 +37,7 @@ CREATE TABLE `link_table` (
KEY `id1_type` (`link_type`, `id1`, `visibility`,`time`,`id2`,`version`,`data`) COMMENT 'cfname=rev:cf_link_id1_type;partial_group_keyparts=2;partial_group_threshold=10'
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;

exec /usr/bin/python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;
exec python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;

DROP TABLE link_table;

Expand All @@ -55,7 +55,7 @@ CREATE TABLE `link_table` (
KEY `id1_type` (`link_type`, `id1`, `visibility`,`time`,`id2`,`version`,`data`(255)) COMMENT 'cfname=rev:cf_link_id1_type;partial_group_keyparts=2;partial_group_threshold=10'
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;

exec /usr/bin/python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;
exec python3 suite/rocksdb/t/partial_index_stress.py root 127.0.0.1 $MASTER_MYPORT test link_table 1000 10;

DROP TABLE link_table;

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/rocksdb/t/rocksdb_deadlock_stress.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set @prior_rocksdb_deadlock_detect = @@rocksdb_deadlock_detect;
set global rocksdb_lock_wait_timeout = 100000;
set global rocksdb_deadlock_detect = ON;

exec /usr/bin/python3 suite/rocksdb/t/rocksdb_deadlock_stress.py root 127.0.0.1 $MASTER_MYPORT test t1 1000 10;
exec python3 suite/rocksdb/t/rocksdb_deadlock_stress.py root 127.0.0.1 $MASTER_MYPORT test t1 1000 10;

set global rocksdb_lock_wait_timeout = @prior_rocksdb_lock_wait_timeout;
set global rocksdb_deadlock_detect = @prior_rocksdb_deadlock_detect;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
src_data_dir="${MYSQLTEST_VARDIR}/mysqld.1/data/"
python2 -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('${src_data_dir}/slocket')"
python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('${src_data_dir}/slocket')"
2 changes: 1 addition & 1 deletion mysql-test/suite/rocksdb_rpl/t/multiclient_2pc.test
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SET DEBUG_SYNC='now SIGNAL go';
--source include/wait_until_connected_again.inc
--disable_reconnect

--exec /usr/bin/python3 suite/rocksdb/t/check_log_for_xa.py $LOG prepare,commit,rollback
--exec python3 suite/rocksdb/t/check_log_for_xa.py $LOG prepare,commit,rollback

select * from t1 where a=1;
select count(*) from t1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ EOF
select "--- slave state after crash recovery, slave stop, one transaction recovered---" as "";
--enable_query_log
connection slave;
--exec /usr/bin/python3 suite/rocksdb/t/check_log_for_xa.py $LOG commit,prepare,rollback
--exec python3 suite/rocksdb/t/check_log_for_xa.py $LOG commit,prepare,rollback
select * from x;
-- replace_result $uuid uuid
select @@global.gtid_executed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ EOF
select "--- slave state after crash recovery, slave stop, one transaction recovered---" as "";
--enable_query_log
connection slave;
--exec /usr/bin/python3 suite/rocksdb/t/check_log_for_xa.py $LOG commit,prepare,rollback
--exec python3 suite/rocksdb/t/check_log_for_xa.py $LOG commit,prepare,rollback

--disable_query_log
select "--- slave state after restart, slave start ---" as "";
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/rocksdb_stress/include/rocksdb_stress.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--let $master_host = 127.0.0.1

let $exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/rocksdb_stress/t/load_generator.py
python3 $MYSQL_TEST_DIR/suite/rocksdb_stress/t/load_generator.py
-L $MYSQL_TMP_DIR/load_generator.log -H $master_host -t $table
-P $MASTER_MYPORT -n $num_records -m $max_records
-l $num_loaders -c $num_checkers -r $num_requests
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/rocksdb_stress/t/drop_cf_stress.test
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ WHILE ($i < $num_cfs)
}

let $exec =
/usr/bin/python3 $MYSQL_TEST_DIR/suite/rocksdb_stress/t/drop_cf_stress.py
python3 $MYSQL_TEST_DIR/suite/rocksdb_stress/t/drop_cf_stress.py
-L $MYSQL_TMP_DIR/drop_cf_stress.log -H $local_host
-P $MASTER_MYPORT
-w $num_workers -r $num_requests -v
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
let $exec = python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events;
let $exec = python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events;
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues;
let $exec = python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues;
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3

"""
Stall generator helper script for MTR.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ while ($i)
let $error_query = sum_error_raised as "errors present" from performance_schema.events_errors_summary_global_by_error where error_name = "ER_MULTI_TENANCY_MAX_CONNECTION";
let $error_count_init = `select $error_query`;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/max_db_connections_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --db_prefix='test_db' --db_count=10;
let $exec = python3 $MYSQL_TEST_DIR/t/max_db_connections_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --db_prefix='test_db' --db_count=10;
exec $exec > $MYSQLTEST_VARDIR/tmp/tp_max_db_connections_stress.output;

let $i = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ grant all on *.* to super_user@localhost with grant option;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --admin='super_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events --thread-pool-on-off;
let $exec = python3 $MYSQL_TEST_DIR/suite/thread_pool/t/admission_control_multi_query.py --user='test_user' --admin='super_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events --thread-pool-on-off;
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/admission_control_multi_query.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
let $exec = python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events;
let $exec = python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --wait-events;
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/admission_control_multi_query_weighted.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grant all on test.* to test_user@localhost;
use test_db;
create table t1 (a int primary key, b int) engine=InnoDB;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues;
let $exec = python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues;
exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output;

drop database test_db;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/max_db_connections_stress.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let $error_query = sum_error_raised as "errors present" from performance_schema.
let $error_count_init = `select $error_query`;


let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/max_db_connections_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --db_prefix='test_db' --db_count=10;
let $exec = python3 $MYSQL_TEST_DIR/t/max_db_connections_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --db_prefix='test_db' --db_count=10;
exec $exec > $MYSQLTEST_VARDIR/tmp/max_db_connections_stress.output;

let $i = 10;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/max_tmp_disk_usage_stress.test
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set global max_tmp_disk_usage = 100000000;
set global temptable_max_ram = 2097152;
set global temptable_use_mmap = off;

let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/max_tmp_disk_usage_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
let $exec = python3 $MYSQL_TEST_DIR/t/max_tmp_disk_usage_stress.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db';
exec $exec > $MYSQLTEST_VARDIR/tmp/max_tmp_disk_usage_stress.output;

drop database test_db;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/slocket_listen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
from socket import socket, AF_UNIX, SOCK_DGRAM
from select import select
from os import unlink, getcwd, stat
Expand Down

0 comments on commit fa795df

Please sign in to comment.