Skip to content

Commit

Permalink
add thread test
Browse files Browse the repository at this point in the history
  • Loading branch information
wsjz committed Jul 15, 2024
1 parent 8db5881 commit a0845e4
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import groovyjarjarantlr4.v4.codegen.model.ExceptionClause

// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand Down Expand Up @@ -66,6 +68,30 @@ suite("test_two_hive_kerberos", "p0,external,kerberos,external_docker,external_d
sql """ use test_krb_hive_db """
order_qt_q02 """ select * from test_krb_hive_db.test_krb_hive_tbl """

// 3. multi thread test
Thread thread1 = new Thread(() -> {
try {
for (int i = 0; i < 500; i++) {
sql """ select * from ${hms_catalog_name}.test_krb_hive_db.test_krb_hive_tbl """
}
} catch (Exception e) {
fail()
}
})

Thread thread2 = new Thread(() -> {
try {
for (int i = 0; i < 500; i++) {
sql """ select * from other_${hms_catalog_name}.test_krb_hive_db.test_krb_hive_tbl """
}
} catch (Exception e) {
fail()
}
})

thread1.start()
thread2.start()

sql """drop catalog ${hms_catalog_name};"""
sql """drop catalog other_${hms_catalog_name};"""
}
Expand Down

0 comments on commit a0845e4

Please sign in to comment.