@Test
  public void testSetSerdeAndFileFormatNonBlocking() throws Exception {
    dropTable(new String[] {"tab_acid"});

    driver.run("create table if not exists tab_acid (a int, b int) partitioned by (p string) " +
      "TBLPROPERTIES ('transactional'='true', 'transactional_properties'='insert_only')");
    driver.run("insert into tab_acid partition(p) (a,b,p) values(1,2,'foo'),(3,4,'bar')");

    driver.compileAndRespond("select * from tab_acid");

    HiveConf.setBoolVar(driver2.getConf(), HiveConf.ConfVars.HIVE_ACID_LOCKLESS_READS_ENABLED, true);
    driver2 = Mockito.spy(driver2);

    DbTxnManager txnMgr2 = (DbTxnManager) TxnManagerFactory.getTxnManagerFactory().getTxnManager(conf);
    swapTxnManager(txnMgr2);

    driver2.compileAndRespond("alter table tab_acid set serde 'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'");
    driver2.lockAndRespond();

    List<ShowLocksResponseElement> locks = getLocks();
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.EXCL_WRITE,
      LockState.ACQUIRED, "default", "tab_acid", null, locks);

    Mockito.doNothing().when(driver2).lockAndRespond();
    driver2.run();
    Mockito.reset(driver2);

    driver2.compileAndRespond("alter table tab_acid set fileformat rcfile");
    driver2.lockAndRespond();

    locks = getLocks();
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.EXCL_WRITE,
      LockState.ACQUIRED, "default", "tab_acid", null, locks);

    Mockito.doNothing().when(driver2).lockAndRespond();
    driver2.run();
    Mockito.reset(driver2);

    driver2.run("insert into tab_acid partition(p) (a,b,p) values(1,2,'foo')");

    swapTxnManager(txnMgr);
    driver.run();

    List<String> res = new ArrayList<>();
    driver.getFetchTask().fetch(res);
    Assert.assertEquals("No records found", 2, res.size());
  }
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