Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acceptance: deflake TestDockerCLI/test_txn_prompt #91249

Merged
merged 1 commit into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/cli/interactive_tests/common.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ proc eexpect {text} {
}
}

# eexpect_re is like eexpect, but takes a regular expression argument
# instead of a text string
proc eexpect_re {text} {
expect {
-re $text {}
timeout { handle_timeout $text }
}
}

# Convenience function that sends Ctrl+C to the monitored process.
proc interrupt {} {
report "INTERRUPT TO FOREGROUND PROCESS"
Expand Down Expand Up @@ -178,4 +187,3 @@ proc stop_tenant {tenant_id argv} {

report "END STOP TENANT $tenant_id"
}

6 changes: 5 additions & 1 deletion pkg/cli/interactive_tests/test_txn_prompt.tcl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ eexpect abcdefaultdbdef

# Check prompt with no formatting code.
send "\\set prompt1 woo \r"
eexpect woo
# use a regular expression to match the `woo` prompt (beginning of
# line). If we use `eexpect` here, the match would happen
# instantaneously as it would match the previous `set prompt1 woo`
# command, as it also contains the string `woo`.
eexpect_re "(?n)^woo $"

send "SET database \r"
eexpect "\r\n -> "
Expand Down