Added tests for binlog_server.#126
Conversation
| --echo | ||
| --echo Executing binlog_server in pull mode without checkpointing | ||
| --let $binsrv_checkpoint_size = | ||
| --let $$binsrv_checkpoint_interval = |
| --remove_file $size_file | ||
|
|
||
| --let EXPORTED_BINSRV_PID = $binsrv_pid | ||
| --exec kill -9 $binsrv_pid |
There was a problem hiding this comment.
kill -9 is basically crash simulation. Didn't you mean do have a graceful shutdown here?
| --exec kill -s TERM $binsrv_pid | ||
| --let EXPORTED_BINSRV_PID = $binsrv_pid | ||
| --perl | ||
| use strict; | ||
| use warnings; | ||
| use Errno; | ||
| my $pid = $ENV{'EXPORTED_BINSRV_PID'}; | ||
| my $not_present = (!kill(0, $pid) && $! == Errno::ESRCH); | ||
| while (!$not_present) { | ||
| sleep(1); | ||
| $not_present = (!kill(0, $pid) && $! == Errno::ESRCH); | ||
| } | ||
| EOF |
There was a problem hiding this comment.
Probably makes sense to create a helper .inc file for this
| --let $binsrv_pid_file = $MYSQL_TMP_DIR/binsrv_size_ckpt.pid | ||
| --let $binsrv_spawn_cmd_line = $BINSRV pull $binsrv_config_file_path > $binsrv_log_path 2>&1 & echo \$! > $binsrv_pid_file | ||
| --let EXPORTED_BINSRV_SPAWN_CMD_LINE = $binsrv_spawn_cmd_line | ||
| --perl | ||
| use strict; | ||
| use warnings; | ||
| my $cmd = $ENV{'EXPORTED_BINSRV_SPAWN_CMD_LINE'}; | ||
| system("$cmd"); | ||
| EOF |
There was a problem hiding this comment.
Probably makes sense to create a helper .inc file for this
| --source include/read_file_to_var.inc | ||
| --let $binsrv_pid = $result | ||
|
|
||
| --sleep 10 |
There was a problem hiding this comment.
Probably we should check the content of PBS log file until we encounter some line that indicates that it already downloaded enough data instead of this sleep.
| --remove_file $binsrv_log_path | ||
| --exec rm -f $binsrv_config_file_path | ||
|
|
||
|
|
There was a problem hiding this comment.
2 empty lines at EOF
| } | ||
| --exec rm -f $binsrv_log_path $binsrv_config_file_path | ||
|
|
||
| if ($MTR_BINSRV_DNS_SRV_NAME != '') |
There was a problem hiding this comment.
May be extract all DNS_SRV checks into a separate MTR test case and skip it completely if $MTR_BINSRV_DNS_SRV_NAME is not defined?
| } | ||
| --exec rm -f $binsrv_log_path $binsrv_config_file_path | ||
|
|
||
|
|
There was a problem hiding this comment.
I would also add
position mode PBS connecting to MySQL server with GTIDs disabled - OK
position mode PBS connecting to MySQL server with GTIDs enabled - OK
gtid mode PBS connecting to MySQL server with GTIDs disabled - not OK
gtid mode PBS connecting to MySQL server with GTIDs enabled - OK
| --echo *** Test : Storage flush after read_timeout disconnection (PS-10320 fix) | ||
| --echo *** This test verifies that local binary log data is flushed to storage | ||
| --echo *** upon disconnection due to read_timeout | ||
| --echo *** This test also verifies existence of teporary files in buffer directory |
| --source ../include/tear_down_binsrv_environment.inc | ||
|
|
||
| DROP TABLE t1; | ||
|
|
There was a problem hiding this comment.
Multiple new lines at EOF
Added tests in binlog_streaming suite to cover the binlog_server test scenarios.
binlog server test plan:
https://www.notion.so/percona/binlog-server-test-plan-2b9674d091f380349b66c8c3d4fcee51