Skip to content

Conversation

@djatnieks
Copy link

CNDB-11460 another fix for cqlsh unicode tests in TestCqlshUnicode - make a second read in read_until to get UTF-8 characters that are split across reads.

What is the issue

The original fix for CNDB-11460 added the ability for the read_tty method to decode UTF-8 characters that get split across reads, by saving a partial buffer when a UnicodeDecodeError happens, and use the partial buffer with the next read. When this happens, read_tty will return '' to the read_until method. The first fix lacked having read_until initiate a second read to read_tty and still failed with an EOFError.

What does this PR fix and why was it fixed

In this PR, the read_until method will make a second call to read_tty (via self.read), allowing read_tty to read another blksize buffer of characters and the chance to decode UTF-8 characters that were split across reads.

To better validate the fix, the test was run locally with a forced blksize = 1 to consistently generate failures and validate that the second read resolves the issue.

Correct me if this is wrong, but afaict our CC CI doesn't have multiplexing capability for cqhsh tests, having separate build parameters in ds-cassandra-build from JVM tests using DSJVMTestRepetitions or DTests using DSDTestRepetitions.

…make a second read in read_until to get UTF-8 characters that are split across reads.
@github-actions
Copy link

github-actions bot commented Mar 3, 2025

Checklist before you submit for review

  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2025

@cassci-bot
Copy link

❌ Build ds-cassandra-pr-gate/PR-1618 rejected by Butler


3 new test failure(s) in 1 builds
See build details here


Found 3 new test failures

Test Explanation Branch history Upstream history
...estInterruptedExceptionCachedCounterLockManager regression 🔴
...TimeoutTest.prepareRPCTimeout[SEQUENTIAL/false] regression 🔴 🔵🔵🔵🔵🔵🔵🔵
o.a.c.s.SensorsIndexWriteTest.BeforeFirstTest regression 🔴

Found 1 known test failures

@djatnieks djatnieks merged commit 267cfd3 into main Mar 4, 2025
467 of 477 checks passed
@djatnieks djatnieks deleted the CNDB-11460-test-cqlsh-unicode-2 branch March 4, 2025 23:23
djatnieks added a commit that referenced this pull request Mar 11, 2025
…1618)

CNDB-11460 another fix for cqlsh unicode tests in TestCqlshUnicode -
make a second read in read_until to get UTF-8 characters that are split
across reads.
djatnieks added a commit that referenced this pull request May 18, 2025
…1618)

CNDB-11460 another fix for cqlsh unicode tests in TestCqlshUnicode -
make a second read in read_until to get UTF-8 characters that are split
across reads.
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.

4 participants