Skip to content

Added tests for binlog_server.#126

Open
ParveezBaig wants to merge 1 commit into
Percona-Lab:0.2from
ParveezBaig:pbs-tests
Open

Added tests for binlog_server.#126
ParveezBaig wants to merge 1 commit into
Percona-Lab:0.2from
ParveezBaig:pbs-tests

Conversation

@ParveezBaig
Copy link
Copy Markdown
Collaborator

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

--echo
--echo Executing binlog_server in pull mode without checkpointing
--let $binsrv_checkpoint_size =
--let $$binsrv_checkpoint_interval =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some weird $$

--remove_file $size_file

--let EXPORTED_BINSRV_PID = $binsrv_pid
--exec kill -9 $binsrv_pid
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kill -9 is basically crash simulation. Didn't you mean do have a graceful shutdown here?

Comment on lines +194 to +206
--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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably makes sense to create a helper .inc file for this

Comment on lines +150 to +158
--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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably makes sense to create a helper .inc file for this

--source include/read_file_to_var.inc
--let $binsrv_pid = $result

--sleep 10
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 empty lines at EOF

}
--exec rm -f $binsrv_log_path $binsrv_config_file_path

if ($MTR_BINSRV_DNS_SRV_NAME != '')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary

--source ../include/tear_down_binsrv_environment.inc

DROP TABLE t1;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple new lines at EOF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants