private void dropDatabaseNonBlocking(boolean allTablesWithSuffix, boolean cascade) throws Exception {
    String database = "mydb";
    String tableName = "tab_acid";
    
    driver.run("drop database if exists " + database + " cascade");
    driver.run("create database " + database);

    HiveConf.setBoolVar(conf, HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED, allTablesWithSuffix);
    // Create transactional table/materialized view with lockless-reads feature disabled
    driver.run("create table " + database + "." + tableName + "1 (a int, b int) " +
      "partitioned by (ds string) stored as orc TBLPROPERTIES ('transactional'='true')");
    driver.run("create materialized view " + database + ".mv_" + tableName + "1 " +
        "partitioned on (ds) stored as orc TBLPROPERTIES ('transactional'='true')" +
      "as select a, ds from " + database + "." + tableName + "1 where b > 1");
    
    HiveConf.setBoolVar(conf, HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED, true);
    // Create transactional table/materialized view with lockless-reads feature enabled
    driver.run("create table " + database + "." + tableName + "2 (a int, b int) " +
      "partitioned by (ds string) stored as orc TBLPROPERTIES ('transactional'='true')");
    driver.run("create materialized view " + database + ".mv_" + tableName + "2 " +
        "partitioned on (ds) stored as orc TBLPROPERTIES ('transactional'='true')" +
      "as select a, ds from " + database + "." + tableName + "2 where b > 1");
    
    if (!allTablesWithSuffix) {
      // Create external table
      driver.run("create external table " + database + ".tab_ext (a int, b int) " +
        "partitioned by (ds string) stored as parquet");
      // Create managed table
      driver.run("create table " + database + ".tab_nonacid (a int, b int) " +
        "partitioned by (ds string) stored as parquet");
    }
    // Drop database cascade
    driver.compileAndRespond("drop database " + database + (cascade ? " cascade" : ""));

    driver.lockAndRespond();
    List<ShowLocksResponseElement> locks = getLocks();
    Assert.assertEquals("Unexpected lock count", cascade && !allTablesWithSuffix ? 6 : 1, locks.size());

    if (cascade && !allTablesWithSuffix) {
      TestTxnDbUtil.checkLock(LockType.EXCLUSIVE,
        LockState.ACQUIRED, database, tableName + "1", null, locks);
      TestTxnDbUtil.checkLock(LockType.EXCLUSIVE,
        LockState.ACQUIRED, database, "mv_" + tableName + "1", null, locks);
      TestTxnDbUtil.checkLock(LockType.EXCL_WRITE,
        LockState.ACQUIRED, database, tableName + "2", null, locks);
      TestTxnDbUtil.checkLock(LockType.EXCL_WRITE,
        LockState.ACQUIRED, database, "mv_" + tableName + "2", null, locks);
      TestTxnDbUtil.checkLock(LockType.EXCLUSIVE,
        LockState.ACQUIRED, database, "tab_nonacid", null, locks);
    
    } else {
      TestTxnDbUtil.checkLock(LockType.EXCL_WRITE,
        LockState.ACQUIRED, database, null, null, locks);
    }
  }
T7 is a table with 2 partitions
1. run select from T7
2. run drop partition from T7
concurrently with 1 starting first so that 2 blocks
3. start another concurrent select on T7 - it should block behind waiting X (from drop) - LM should be fair
4. finish #1 so that drop unblocks
5. rollback the drop to release its X lock
6. # should unblock
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java