-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
pkg/sql/logictest: Test data containing multi-line values causes test to fail #127785
Labels
branch-master
Failures and bugs on the master branch.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-observability
Comments
kyle-a-wong
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
Jul 26, 2024
Hi @kyle-a-wong, please add branch-* labels to identify which branch(es) this C-bug affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
kyle-a-wong
added a commit
to kyle-a-wong/cockroach
that referenced
this issue
Jul 30, 2024
logictest generated test data formats query results in a in a tabular format using tabwriter. when a query result contains `\n` characters, it formats it such that stays within the same tab cell on output. This works well when there is a single row result, but when there are multiple rows with data that contains `\n` characters, the intput parser doesn't know, nor can it tell, if a cell is multi-lined or not, erroneously reporting that data expected data and actual data don't match. To Fix, multi-row query responses will now replace `\n` characters with `\\n` to ensure tests pass while being well formatted. Fixes: cockroachdb#127785 Release note: None
kyle-a-wong
added a commit
to kyle-a-wong/cockroach
that referenced
this issue
Jul 31, 2024
logictest generated test data formats query results in a in a tabular format using tabwriter. when a query result contains `\n` characters, it formats it such that stays within the same tab cell on output. This works well when there is a single row result, but when there are multiple rows with data that contains `\n` characters, the intput parser doesn't know, nor can it tell, if a cell is multi-lined or not, erroneously reporting that data expected data and actual data don't match. To Fix, multi-row query responses will now replace `\n` characters with `\\n` to ensure tests pass while being well formatted. Fixes: cockroachdb#127785 Release note: None
craig bot
pushed a commit
that referenced
this issue
Jul 31, 2024
127773: sql/logictest: Fixes logic test tabular data output r=kyle-a-wong a=kyle-a-wong logictest generated test data formats query results in a in a tabular format using tabwriter. when a query result contains `\n` characters, it formats it such that stays within the same tab cell on output. This works well when there is a single row result, but when there are multiple rows with data that contains `\n` characters, the input parser doesn't know, nor can it tell, if a cell is multi-lined or not, erroneously reporting that data expected data and actual data don't match. To Fix, multi-row query responses will now replace `\n` characters with `\\n` to ensure tests pass while being well formatted. Fixes: #127785 Release note: None Co-authored-by: Kyle Wong <37189875+kyle-a-wong@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
branch-master
Failures and bugs on the master branch.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-observability
Describe the problem
In #91702, logic was added to
formatValues
to fix an issue where tab and new line characters were interfering with the tab writer output. This fix introduced an edge case where tabular data outputs containing new lines would fail equality checks erroneously.As an example the following test data file,
Would fail with the following error:
The reason the test fails is because the data that is generated and written to the test data file is being formatted to neatly present multi-line data in a column. When this data is read into the test as the
expected
data, it doesn't know that it is a part of a multi-line column and generates an incorrectexpected
value.This bug is manifesting itself in #127290 where the new system table is causing
TestLogic_gen_test_objects/templates/fewer_tables_generated_than_templates
to fail with the following:See the image below of some relevant expressions when running through a debugger:
Jira issue: CRDB-40596
The text was updated successfully, but these errors were encountered: