Repository: asterixdb Updated Branches: refs/heads/master 733fba8e4 -> 40ed45f89
[ASTERIXDB-2196][TEST] Fix MultiPartitionLSMIndexTest - user model changes: no - storage format changes: no - interface changes: no Details: - There is a small window where a flush can be scheduled during the check of the component ids. This is avoided now by waiting for all io operations. Change-Id: I7da1ba5859aea4e75eca605113a1f72faa1914c2 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2219 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/40ed45f8 Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/40ed45f8 Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/40ed45f8 Branch: refs/heads/master Commit: 40ed45f89ef19891fef6750e005aa48010d61da7 Parents: 733fba8 Author: Abdullah Alamoudi <[email protected]> Authored: Tue Dec 12 11:37:47 2017 -0800 Committer: Murtadha Hubail <[email protected]> Committed: Tue Dec 12 13:30:53 2017 -0800 ---------------------------------------------------------------------- .../test/dataflow/MultiPartitionLSMIndexTest.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/40ed45f8/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/MultiPartitionLSMIndexTest.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/MultiPartitionLSMIndexTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/MultiPartitionLSMIndexTest.java index c12f50c..8b8c600 100644 --- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/MultiPartitionLSMIndexTest.java +++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/MultiPartitionLSMIndexTest.java @@ -562,9 +562,25 @@ public class MultiPartitionLSMIndexTest { } // ensure that the insert completes insertReq.await(); - // ensure the two memory components at partition 0 have different component ids + dsLifecycleMgr.getDatasetInfo(DATASET_ID).waitForIO(); + // check first partition + List<ILSMDiskComponent> secondaryDiskComponents = secondaryLsmBtrees[0].getDiskComponents(); + List<ILSMDiskComponent> primaryDiskComponents = primaryLsmBtrees[0].getDiskComponents(); + for (int i = 0; i < secondaryDiskComponents.size(); i++) { + Assert.assertEquals(secondaryDiskComponents.get(i).getId(), primaryDiskComponents.get(i).getId()); + } + // check second partition + secondaryDiskComponents = secondaryLsmBtrees[1].getDiskComponents(); + primaryDiskComponents = primaryLsmBtrees[1].getDiskComponents(); + for (int i = 0; i < secondaryDiskComponents.size(); i++) { + Assert.assertEquals(secondaryDiskComponents.get(i).getId(), primaryDiskComponents.get(i).getId()); + } + // ensure the two memory components at partition 0 have the same component ids Assert.assertEquals(primaryLsmBtrees[0].getCurrentMemoryComponent().getId(), secondaryLsmBtrees[0].getCurrentMemoryComponent().getId()); + // ensure the two memory components at partition 0 have the same component ids + Assert.assertEquals(primaryLsmBtrees[1].getCurrentMemoryComponent().getId(), + secondaryLsmBtrees[1].getCurrentMemoryComponent().getId()); } catch (Throwable e) { e.printStackTrace(); Assert.fail(e.getMessage());
