Skip to content

Fixed testAggregateExpr test#2940

Open
yesh385 wants to merge 1 commit intoMyCATApache:mainfrom
yesh385:fix-flaky
Open

Fixed testAggregateExpr test#2940
yesh385 wants to merge 1 commit intoMyCATApache:mainfrom
yesh385:fix-flaky

Conversation

@yesh385
Copy link
Copy Markdown

@yesh385 yesh385 commented Oct 18, 2023

This PR fixes a test called DruidMysqlRouteStrategyTest.testAggregateExpr which can be found here.

  1. What does this test do?

This test is responsible for testing the behavior of the route strategy when processing SQL queries with aggregate functions and different aliasing scenarios. It checks if the result set correctly identifies and names the aggregated columns.

  1. Why does this test fail?

This test fails because we are checking if the HashMap returned by getMergeCols() method contains the column name as a key while not checking for case sensitivity.

  1. How I fixed?

This PR fixes this issue by updating the key name into uppercase.

The assertion happens here:

Assert.assertTrue(rrs.getMergeCols().containsKey("count2"));

You can run the following command to run the test:

mvn test -Dtest=io.mycat.route.DruidMysqlRouteStrategyTest#testAggregateExpr

Test Environment:

java version "1.8.0_202"
Apache Maven 3.6.3

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.

1 participant