@@ -447,3 +447,46 @@ PG Session Debug Off Behaviour Canonical
447447 ... AND Remove Environment Variable PGPORT
448448 ... AND Remove Environment Variable PGUSER
449449 ... AND Remove Environment Variable PGPASSWORD
450+
451+ Server Stability PG Session Repeat AWS EC2 Select
452+ [Documentation] Repeat the same query over psql many times as a marker of server stability
453+ Set Environment Variable PGHOST ${PSQL_CLIENT_HOST }
454+ Set Environment Variable PGPORT ${PG_SRV_PORT_UNENCRYPTED }
455+ Set Environment Variable PGUSER stackql
456+ Set Environment Variable PGPASSWORD ${PSQL_PASSWORD }
457+ ${inputStr } = Catenate
458+ ... select
459+ ... instanceId, ipAddress
460+ ... from aws.ec2.instances
461+ ... where
462+ ... region = 'ap-southeast-2'
463+ ... and instanceId not in ('some-silly-id')
464+ ... and ipAddress in ('54.194.252.215')
465+ ... and region in ('ap-southeast-2')
466+ ... ;
467+ ${outputStr } = Catenate SEPARATOR=\n
468+ ... instanceId | ipAddress
469+ ... ---------------------+----------------
470+ ... i-1234567890abcdef0 | 54.194.252.215
471+ ... (1 row)
472+ FOR ${index } IN RANGE 100
473+ LOG runnning index = ${index }
474+ ${posixInput } = Catenate
475+ ... "${PSQL_EXE } " -c "${inputStr } "
476+ ${windowsInput } = Catenate
477+ ... & ${posixInput }
478+ ${input } = Set Variable If "${IS_WINDOWS } " == "1 " ${windowsInput } ${posixInput }
479+ ${shellExe } = Set Variable If "${IS_WINDOWS } " == "1 " powershell sh
480+ ${result } = Run Process
481+ ... ${shellExe } \-c ${input }
482+ ... stdout=${CURDIR } /tmp/Server-Stability-PG-Session-Repeat-AWS-EC2-Select-${index } .tmp
483+ ... stderr=${CURDIR } /tmp/Server-Stability-PG-Session-Repeat-AWS-EC2-Select-${index } -stderr.tmp
484+ Log STDOUT = "${result.stdout } "
485+ Log STDERR = "${result.stderr } "
486+ Should Contain ${result.stdout } ${outputStr } collapse_spaces=True
487+ Should Be Empty ${result.stderr }
488+ END
489+ [Teardown] Run Keywords Remove Environment Variable PGHOST
490+ ... AND Remove Environment Variable PGPORT
491+ ... AND Remove Environment Variable PGUSER
492+ ... AND Remove Environment Variable PGPASSWORD
0 commit comments