kkhatua commented on a change in pull request #1714: DRILL-7048: Implement JDBC Statement.setMaxRows() with System Option URL: https://github.com/apache/drill/pull/1714#discussion_r269237610
########## File path: exec/jdbc/src/test/java/org/apache/drill/jdbc/PreparedStatementTest.java ########## @@ -72,12 +73,18 @@ public class PreparedStatementTest extends JdbcTestBase { private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PreparedStatementTest.class); + private static final Random RANDOMIZER = new Random(20150304); private static final String SYS_VERSION_SQL = "select * from sys.version"; private static final String SYS_RANDOM_SQL = "SELECT cast(random() as varchar) as myStr FROM (VALUES(1)) " + "union SELECT cast(random() as varchar) as myStr FROM (VALUES(1)) " + "union SELECT cast(random() as varchar) as myStr FROM (VALUES(1)) "; + private static final String SYS_OPTIONS_SQL = "SELECT * FROM sys.options"; + private static final String SYS_OPTIONS_SQL_LIMIT_10 = "SELECT * FROM sys.options LIMIT 12"; + private static final String ALTER_SYS_OPTIONS_MAX_ROWS_LIMIT_X = "ALTER SYSTEM SET `" + ExecConstants.QUERY_MAX_ROWS + "`="; + //Locks used across StatementTest and PreparedStatementTest + private static Semaphore maxRowsSysOptionLock = StatementTest.maxRowsSysOptionLock; Review comment: I tried that, but the unit tests attempt to test with setting up specific SYSTEM values. Without this, there is a race condition where both `StatementTest` and `PreparedStatementTest` attempt to set SYSTEM values... and get different results (resulting in test failures). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services