This is an automated email from the ASF dual-hosted git repository.

alsuliman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new cf668f88f8 [ASTERIXDB-3320][TEST] Adapt tests to change in index 
deactivate
cf668f88f8 is described below

commit cf668f88f86b619737e0d9293f939bcefdb6b2ca
Author: Ali Alsuliman <[email protected]>
AuthorDate: Thu Nov 23 22:09:42 2023 -0800

    [ASTERIXDB-3320][TEST] Adapt tests to change in index deactivate
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    Change-Id: I14d0dccfebba77c9639fec9aa017f025fc951627
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17982
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Ali Alsuliman <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
    Reviewed-by: Wail Alkowaileet <[email protected]>
---
 .../am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java  |  1 +
 .../storage/am/common/AbstractIndexLifecycleTest.java     |  2 +-
 .../ondisk/OnDiskInvertedIndexLifecycleTest.java          | 15 +++++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
index 48a173e17c..97a541adfb 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
@@ -171,6 +171,7 @@ public class OnDiskInvertedIndex implements 
IInPlaceInvertedIndex {
     @Override
     public synchronized void deactivate() throws HyracksDataException {
         if (!isOpen && wasOpen) {
+            //TODO(ali): should return instead of throwing similar to other 
indexes
             throw new HyracksDataException("Failed to deactivate the index 
since it is already deactivated.");
         }
         btree.deactivate();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
 
b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
index de8bdc8c75..c0882a7989 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/common/AbstractIndexLifecycleTest.java
@@ -150,7 +150,7 @@ public abstract class AbstractIndexLifecycleTest {
         }
     }
 
-    @Test(expected = HyracksDataException.class)
+    @Test
     public void invalidSequenceTest6() throws Exception {
         index.create();
         index.activate();
diff --git 
a/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexLifecycleTest.java
 
b/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexLifecycleTest.java
index 1b17ef91e0..2150bdbc14 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexLifecycleTest.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-invertedindex-test/src/test/java/org/apache/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndexLifecycleTest.java
@@ -21,6 +21,7 @@ package 
org.apache.hyracks.storage.am.lsm.invertedindex.ondisk;
 
 import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.FileReference;
 import org.apache.hyracks.data.std.accessors.IntegerBinaryComparatorFactory;
 import org.apache.hyracks.data.std.accessors.UTF8StringBinaryComparatorFactory;
@@ -31,6 +32,7 @@ import 
org.apache.hyracks.storage.am.common.api.ITreeIndexFrame;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.api.IInvertedListBuilder;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.common.LSMInvertedIndexTestHarness;
 import 
org.apache.hyracks.storage.am.lsm.invertedindex.ondisk.fixedsize.FixedSizeElementInvertedListBuilder;
+import org.junit.Test;
 
 public class OnDiskInvertedIndexLifecycleTest extends 
AbstractIndexLifecycleTest {
 
@@ -88,4 +90,17 @@ public class OnDiskInvertedIndexLifecycleTest extends 
AbstractIndexLifecycleTest
     protected void clearCheckableInsertions() throws Exception {
         // Do nothing.
     }
+
+    @Test(expected = HyracksDataException.class)
+    @Override
+    public void invalidSequenceTest6() throws Exception {
+        index.create();
+        index.activate();
+        index.deactivate();
+        try {
+            index.deactivate();
+        } finally {
+            index.destroy();
+        }
+    }
 }

Reply via email to