Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1985

MongoDB integration test failures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.14.0
    • None
    • mongodb-adapter
    • None

    Description

      Test output below. The failure of testProject looks acceptable, although it does seem better to project the constant after the sort. Not sure what's going on with testDistinctCount.

      testProject(org.apache.calcite.test.MongoAdapterIT)  Time elapsed: 28.37 sec  <<< FAILURE!
      org.junit.ComparisonFailure:
      expected MongoDB query not found expected:<{$project: {[CITY: '$city', STATE: '$state'}}
      {$sort: {STATE: 1, CITY: 1}}
      {$project: {STATE: 1, CITY: 1, ZERO: {$literal: 0}]}}> but was:<{$project: {[STATE: '$state', CITY: '$city', ZERO: {$literal: 0}}}
      {$sort: {STATE: 1, CITY: 1]}}>
              at org.junit.Assert.assertEquals(Assert.java:115)
              at org.apache.calcite.test.CalciteAssert.assertArrayEqual(CalciteAssert.java:850)
              at org.apache.calcite.test.MongoAdapterIT$1.apply(MongoAdapterIT.java:132)
              at org.apache.calcite.test.MongoAdapterIT$1.apply(MongoAdapterIT.java:126)
              at org.apache.calcite.test.CalciteAssert$AssertQuery.queryContains(CalciteAssert.java:1527)
              at org.apache.calcite.test.MongoAdapterIT.testProject(MongoAdapterIT.java:679)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
              at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
              at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      
      testDistinctCount(org.apache.calcite.test.MongoAdapterIT)  Time elapsed: 20.163 sec  <<< FAILURE!
      org.junit.ComparisonFailure:
      expected MongoDB query not found expected:<...', STATE: '$state'}}[
      {$group: {_id: {CITY: '$CITY', STATE: '$STATE'}}}
      {$project: {_id: 0, CITY: '$_id.CITY', STATE: '$_id.STATE'}}
      {$group: {_id: '$STATE', CDC: {$sum: {$cond: [ {$eq: ['CITY', null]}, 0, 1]}}}}
      {$project: {STATE: '$_id', CDC: '$CDC'}}
      {$sort: {STATE: 1}}]> but was:<...', STATE: '$state'}}[]>
              at org.junit.Assert.assertEquals(Assert.java:115)
              at org.apache.calcite.test.CalciteAssert.assertArrayEqual(CalciteAssert.java:850)
              at org.apache.calcite.test.MongoAdapterIT$1.apply(MongoAdapterIT.java:132)
              at org.apache.calcite.test.MongoAdapterIT$1.apply(MongoAdapterIT.java:126)
              at org.apache.calcite.test.CalciteAssert$AssertQuery.queryContains(CalciteAssert.java:1527)
              at org.apache.calcite.test.MongoAdapterIT.testDistinctCount(MongoAdapterIT.java:625)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
              at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
              at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:393)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      
      
      Results :
      
      Failed tests:
        MongoAdapterIT.testDistinctCount:625 expected MongoDB query not found expected:<...', STATE: '$state'}}[
      {$group: {_id: {CITY: '$CITY', STATE: '$STATE'}}}
      {$project: {_id: 0, CITY: '$_id.CITY', STATE: '$_id.STATE'}}
      {$group: {_id: '$STATE', CDC: {$sum: {$cond: [ {$eq: ['CITY', null]}, 0, 1]}}}}
      {$project: {STATE: '$_id', CDC: '$CDC'}}
      {$sort: {STATE: 1}}]> but was:<...', STATE: '$state'}}[]>
        MongoAdapterIT.testProject:679 expected MongoDB query not found expected:<{$project: {[CITY: '$city', STATE: '$state'}}
      {$sort: {STATE: 1, CITY: 1}}
      {$project: {STATE: 1, CITY: 1, ZERO: {$literal: 0}]}}> but was:<{$project: {[STATE: '$state', CITY: '$city', ZERO: {$literal: 0}}}
      {$sort: {STATE: 1, CITY: 1]}}>
      
      Tests run: 32, Failures: 2, Errors: 0, Skipped: 4
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmior Michael Mior
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: