You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "TedCraft (via GitHub)" <gi...@apache.org> on 2024/11/24 23:33:25 UTC

[I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

TedCraft opened a new issue, #33789:
URL: https://github.com/apache/shardingsphere/issues/33789

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   Latest.
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ### Expected behavior
   
   Tests passed, build completed successfully.
   
   ### Actual behavior
   
   PostgreSQLTablePropertiesLoaderTest.assertLoad(), PostgreSQLPipelineFreemarkerManagerTest.assertGetSQLByDefaultVersion() and PostgreSQLIndexSQLGeneratorTest.assertGenerate() tests fails.
   
   ### Reason analyze (If you can)
   
   Tests fails because of using System.lineSeparator() in mocking and asserting SQL strings. Windows uses \r\n as a line separator, when Linux uses \n and corresponding .ftl files also uses \n. 
   
   For exmaple, in PostgreSQLIndexGeneratorTest executeQuery function is mocked. When it contains string ```"SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as name," + System.lineSeparator() + "(SELECT (CASE WHEN count(i.inhrelid) > 0 THEN true ELSE false END)"``` it should return getNodesResultSet. In Linux systems this string is looking exactly as corresponding string in nodes.ftl file, but on Windows behaviour of System.lineSeparator() is different and as a result executeQuery returns null.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   Run postgresql data-pipeline tests on Windows machine.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #33789:
URL: https://github.com/apache/shardingsphere/issues/33789#issuecomment-2522808217

   It is better to use `System.lineSeparator()` instead of `\n` for platforms different, is it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

Posted by "omkar-shitole (via GitHub)" <gi...@apache.org>.
omkar-shitole commented on issue #33789:
URL: https://github.com/apache/shardingsphere/issues/33789#issuecomment-2522771852

   Hello,
   I reviewed the bug report and identified that using `System.lineSeparator()` on Windows adds `\r\n` line endings, which do not match the` \n` line endings used in the text files configured in the repository.
   This mismatch causes test failures on Windows systems.
   
   To address this, I propose replacing `System.lineSeparator()` with `"\n"` to ensure consistency across platforms. Since `.ftl` and other text files in the repository use \n as the standard line separator, this change will ensure tests behave consistently regardless of the operating system.
   
   I have some changes ready. Could you please assign this issue to me?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #33789:
URL: https://github.com/apache/shardingsphere/issues/33789#issuecomment-2522818410

   @omkar-shitole Great, please go ahead!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #33789:
URL: https://github.com/apache/shardingsphere/issues/33789#issuecomment-2522801555

   Why using System.lineSeparator() on Windows adds \r\n will line endings, Is it a bug for System.lineSeparator()?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Postgresql data-pipeline tests fails to run on Windows machine [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #33789: Postgresql data-pipeline tests fails to run on Windows machine
URL: https://github.com/apache/shardingsphere/issues/33789


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org