Merge branch '3.0' into test3.0/lihui
This commit is contained in:
commit
a243e267bc
|
@ -91,7 +91,7 @@ Add following dependency in the `pom.xml` file of your Maven project:
|
|||
You can build Java connector from source code after cloning the TDengine project:
|
||||
|
||||
```
|
||||
git clone https://github.com/taosdata/taos-connector-jdbc.git
|
||||
git clone https://github.com/taosdata/taos-connector-jdbc.git --branch 2.0
|
||||
cd taos-connector-jdbc
|
||||
mvn clean install -Dmaven.test.skip=true
|
||||
```
|
||||
|
@ -140,34 +140,34 @@ When you use a JDBC native connection to connect to a TDengine cluster, you can
|
|||
|
||||
1. Do not specify hostname and port in Java applications.
|
||||
|
||||
```java
|
||||
public Connection getConn() throws Exception{
|
||||
Class.forName("com.taosdata.jdbc.TSDBDriver");
|
||||
String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata";
|
||||
Properties connProps = new Properties();
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
|
||||
Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
|
||||
return conn;
|
||||
}
|
||||
```
|
||||
```java
|
||||
public Connection getConn() throws Exception{
|
||||
Class.forName("com.taosdata.jdbc.TSDBDriver");
|
||||
String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata";
|
||||
Properties connProps = new Properties();
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
|
||||
connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
|
||||
Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
|
||||
return conn;
|
||||
}
|
||||
```
|
||||
|
||||
2. specify the firstEp and the secondEp in the configuration file taos.cfg
|
||||
|
||||
```shell
|
||||
# first fully qualified domain name (FQDN) for TDengine system
|
||||
firstEp cluster_node1:6030
|
||||
```shell
|
||||
# first fully qualified domain name (FQDN) for TDengine system
|
||||
firstEp cluster_node1:6030
|
||||
|
||||
# second fully qualified domain name (FQDN) for TDengine system, for cluster only
|
||||
secondEp cluster_node2:6030
|
||||
# second fully qualified domain name (FQDN) for TDengine system, for cluster only
|
||||
secondEp cluster_node2:6030
|
||||
|
||||
# default system charset
|
||||
# charset UTF-8
|
||||
# default system charset
|
||||
# charset UTF-8
|
||||
|
||||
# system locale
|
||||
# locale en_US.UTF-8
|
||||
```
|
||||
# system locale
|
||||
# locale en_US.UTF-8
|
||||
```
|
||||
|
||||
In the above example, JDBC uses the client's configuration file to establish a connection to a hostname `cluster_node1`, port 6030, and a database named `test`. When the firstEp node in the cluster fails, JDBC attempts to connect to the cluster using secondEp.
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ Maven 项目中,在 pom.xml 中添加以下依赖:
|
|||
可以通过下载 TDengine 的源码,自己编译最新版本的 Java connector
|
||||
|
||||
```shell
|
||||
git clone https://github.com/taosdata/taos-connector-jdbc.git
|
||||
git clone https://github.com/taosdata/taos-connector-jdbc.git --branch 2.0
|
||||
cd taos-connector-jdbc
|
||||
mvn clean install -Dmaven.test.skip=true
|
||||
```
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
static const int32_t TEST_NUMBER = 1;
|
||||
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
|
||||
#define SIMPLE8B_MAX_INT64 ((uint64_t)2305843009213693951LL)
|
||||
#define SIMPLE8B_MAX_INT64 ((uint64_t)1152921504606846974LL)
|
||||
|
||||
#define safeInt64Add(a, b) (((a >= 0) && (b <= INT64_MAX - a)) || ((a < 0) && (b >= INT64_MIN - a)))
|
||||
#define ZIGZAG_ENCODE(T, v) ((u##T)((v) >> (sizeof(T) * 8 - 1))) ^ (((u##T)(v)) << 1) // zigzag encode
|
||||
|
@ -101,8 +101,8 @@ int32_t tsCompressINTImp(const char *const input, const int32_t nelements, char
|
|||
char bit_per_integer[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 30, 60};
|
||||
int32_t selector_to_elems[] = {240, 120, 60, 30, 20, 15, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1};
|
||||
char bit_to_selector[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15};
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15};
|
||||
|
||||
// get the byte limit.
|
||||
int32_t word_length = 0;
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
./test.sh -f tsim/insert/basic.sim
|
||||
./test.sh -f tsim/insert/basic0.sim
|
||||
./test.sh -f tsim/insert/basic1.sim
|
||||
./test.sh -f tsim/insert/basic2.sim
|
||||
./test.sh -f tsim/insert/commit-merge0.sim
|
||||
./test.sh -f tsim/insert/insert_drop.sim
|
||||
./test.sh -f tsim/insert/insert_select.sim
|
||||
|
|
|
@ -0,0 +1,322 @@
|
|||
system sh/stop_dnodes.sh
|
||||
system sh/deploy.sh -n dnode1 -i 1
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
print =============== create database
|
||||
sql create database d0 keep 365000d,365000d,365000d
|
||||
sql use d0
|
||||
|
||||
print =============== create super table
|
||||
sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20));
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== create child table
|
||||
sql create table ct1 using stb tags("BeiJing", "ChaoYang")
|
||||
sql create table ct2 using stb tags("BeiJing", "HaiDian")
|
||||
|
||||
sql show tables
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step3-1 insert records into ct1
|
||||
sql insert into ct1 values('2022-05-03 16:59:00.010', 10, 20, 'n','n',30);
|
||||
sql insert into ct1 values('2022-05-03 16:59:00.011', 'N', 'n', 'N',"N",30);
|
||||
sql insert into ct1 values('2022-05-03 16:59:00.012', 'Nu', 'nul', 'Nul','NUL',30);
|
||||
sql insert into ct1 values('2022-05-03 16:59:00.013', NULL, 'null', 'Null',null,30);
|
||||
sql insert into ct1 values('2022-05-03 16:59:00.014', NULL, 'NuLL', 'Null',NULL,30);
|
||||
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',NUL,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',NU,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',Nu,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', NULL, 20, 'Null',N,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', N, 20, 'Null',NULL,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', Nu, 20, 'Null',NULL,30);
|
||||
sql_error insert into ct1 values('2022-05-03 16:59:00.015', Nul, 20, 'Null',NULL,30);
|
||||
|
||||
print =============== step3-1 query records of ct1 from memory
|
||||
sql select * from ct1;
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05
|
||||
print $data10 $data11 $data12 $data13 $data14 $data15
|
||||
print $data20 $data21 $data22 $data23 $data24 $data25
|
||||
print $data30 $data31 $data32 $data33 $data34 $data35
|
||||
print $data40 $data41 $data42 $data43 $data44 $data45
|
||||
|
||||
if $rows != 5 then
|
||||
print rows $rows != 5
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data01 != 10 then
|
||||
print data01 $data01 != 10
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data02 != 20.000000000 then
|
||||
print data02 $data02 != 20.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data03 != n then
|
||||
print data03 $data03 != n
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data04 != n then
|
||||
print data04 $data04 != n
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data05 != 30.000000000 then
|
||||
print data05 $data05 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != NULL then
|
||||
print data11 $data11 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data12 != NULL then
|
||||
print data12 $data12 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data13 != N then
|
||||
print data13 $data13 != N
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data14 != N then
|
||||
print data14 $data14 != N
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data15 != 30.000000000 then
|
||||
print data15 $data15 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data21 != NULL then
|
||||
print data21 $data21 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data22 != NULL then
|
||||
print data22 $data22 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data23 != Nul then
|
||||
print data23 $data23 != Nul
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data24 != NUL then
|
||||
print data24 $data24 != NUL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data25 != 30.000000000 then
|
||||
print data25 $data25 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data31 != NULL then
|
||||
print data31 $data31 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data32 != NULL then
|
||||
print data32 $data32 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data33 != Null then
|
||||
print data33 $data33 != Null
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data34 != NULL then
|
||||
print data34 $data34 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data35 != 30.000000000 then
|
||||
print data35 $data35 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data41 != NULL then
|
||||
print data41 $data41 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data42 != NULL then
|
||||
print data42 $data42 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data43 != Null then
|
||||
print data43 $data43 != Null
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data44 != NULL then
|
||||
print data44 $data44 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data45 != 30.000000000 then
|
||||
print data45 $data45 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
#==================== reboot to trigger commit data to file
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
print =============== step3-2 query records of ct1 from file
|
||||
sql select * from ct1;
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05
|
||||
print $data10 $data11 $data12 $data13 $data14 $data15
|
||||
print $data20 $data21 $data22 $data23 $data24 $data25
|
||||
print $data30 $data31 $data32 $data33 $data34 $data35
|
||||
print $data40 $data41 $data42 $data43 $data44 $data45
|
||||
|
||||
if $rows != 5 then
|
||||
print rows $rows != 5
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data01 != 10 then
|
||||
print data01 $data01 != 10
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data02 != 20.000000000 then
|
||||
print data02 $data02 != 20.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data03 != n then
|
||||
print data03 $data03 != n
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data04 != n then
|
||||
print data04 $data04 != n
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data05 != 30.000000000 then
|
||||
print data05 $data05 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != NULL then
|
||||
print data11 $data11 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data12 != NULL then
|
||||
print data12 $data12 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data13 != N then
|
||||
print data13 $data13 != N
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data14 != N then
|
||||
print data14 $data14 != N
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data15 != 30.000000000 then
|
||||
print data15 $data15 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data21 != NULL then
|
||||
print data21 $data21 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data22 != NULL then
|
||||
print data22 $data22 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data23 != Nul then
|
||||
print data23 $data23 != Nul
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data24 != NUL then
|
||||
print data24 $data24 != NUL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data25 != 30.000000000 then
|
||||
print data25 $data25 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data31 != NULL then
|
||||
print data31 $data31 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data32 != NULL then
|
||||
print data32 $data32 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data33 != Null then
|
||||
print data33 $data33 != Null
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data34 != NULL then
|
||||
print data34 $data34 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data35 != 30.000000000 then
|
||||
print data35 $data35 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data41 != NULL then
|
||||
print data41 $data41 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data42 != NULL then
|
||||
print data42 $data42 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data43 != Null then
|
||||
print data43 $data43 != Null
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data44 != NULL then
|
||||
print data44 $data44 != NULL
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data45 != 30.000000000 then
|
||||
print data45 $data45 != 30.000000000
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -242,3 +242,5 @@ else
|
|||
$reboot_cnt = $reboot_cnt + 1
|
||||
goto reboot_and_check
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -226,4 +226,6 @@ endi
|
|||
if $data41 != NULL then
|
||||
print data41 $data41 != NULL
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -816,4 +816,6 @@ endi
|
|||
if $data44 != n8 then
|
||||
print data44 $data44 != n8
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -179,4 +179,6 @@ if $data05 != 30.000000000 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
||||
|
||||
|
|
|
@ -136,9 +136,14 @@ class TDTestCase:
|
|||
|
||||
tdSql.query("SELECT _wstart,model,fleet,count(ms1)/144 FROM (SELECT _wstart as ts1,model, fleet,avg(status) AS ms1 FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition by model, fleet interval(10m) fill(value,0)) WHERE ts1 >= '2016-01-01T00:00:00Z' AND ts1 < '2016-01-05T00:00:01Z' AND ms1<1 partition by model, fleet interval(1d) ;")
|
||||
|
||||
tdSql.query("SELECT _wstart,model,fleet,count(ms1)/144 FROM (SELECT _wstart as ts1,model, fleet,avg(status) AS ms1 FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition by model, fleet interval(10m) ) WHERE ts1 >= '2016-01-01T00:00:00Z' AND ts1 < '2016-01-05T00:00:01Z' AND ms1<1 partition by model, fleet interval(1d) ;")
|
||||
|
||||
|
||||
# 9. breakdown-frequency
|
||||
# NULL ---count(NULL)=0 expect count(NULL)= 100
|
||||
tdSql.query("SELECT model,state_changed,count(state_changed) FROM (SELECT model,diff(broken_down) AS state_changed FROM (SELECT _wstart,model,cast(cast(floor(2*(sum(nzs)/count(nzs))) as bool) as int) AS broken_down FROM (SELECT ts,model, cast(cast(status as bool) as int) AS nzs FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' ) WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition BY model interval(10m)) partition BY model) where model is null partition BY model,state_changed ")
|
||||
parRows=tdSql.queryRows
|
||||
assert parRows != 0 , "query result is wrong"
|
||||
|
||||
|
||||
tdSql.query(" SELECT model,state_changed,count(state_changed) FROM (SELECT model,diff(broken_down) AS state_changed FROM (SELECT _wstart,model,cast(cast(floor(2*(sum(nzs)/count(nzs))) as bool) as int) AS broken_down FROM (SELECT ts,model, cast(cast(status as bool) as int) AS nzs FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' ) WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition BY model interval(10m)) partition BY model) where state_changed =1 partition BY model,state_changed ;")
|
||||
|
|
|
@ -93,7 +93,7 @@ class TDTestCase:
|
|||
def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole):
|
||||
tdLog.printNoPrefix("======== test case 1: ")
|
||||
paraDict = {'dbName': 'db',
|
||||
'dbNumbers': 20,
|
||||
'dbNumbers': 8,
|
||||
'dropFlag': 1,
|
||||
'event': '',
|
||||
'vgroups': 4,
|
||||
|
@ -183,15 +183,22 @@ class TDTestCase:
|
|||
|
||||
for tr in threads:
|
||||
tr.join()
|
||||
tdLog.info("check dnode number:")
|
||||
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||
clusterComCheck.checkDbRows(allDbNumbers)
|
||||
for i in range(restartNumbers):
|
||||
clusterComCheck.checkDb(paraDict['dbNumbers'],restartNumbers,dbNameIndex = '%s%d'%(paraDict["dbName"],i))
|
||||
tdSql.query("show databases")
|
||||
tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers-2))
|
||||
|
||||
# tdLog.info("check DB Rows:")
|
||||
# clusterComCheck.checkDbRows(allDbNumbers)
|
||||
# tdLog.info("check DB Status on by on")
|
||||
# for i in range(restartNumbers):
|
||||
# clusterComCheck.checkDb(paraDict['dbNumbers'],restartNumbers,dbNameIndex = '%s%d'%(paraDict["dbName"],i))
|
||||
|
||||
|
||||
|
||||
def run(self):
|
||||
# print(self.master_dnode.cfgDict)
|
||||
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=2,stopRole='dnode')
|
||||
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=10,stopRole='dnode')
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -98,7 +98,7 @@ class TDTestCase:
|
|||
'vgroups': 4,
|
||||
'replica': 1,
|
||||
'stbName': 'stb',
|
||||
'stbNumbers': 100,
|
||||
'stbNumbers': 80,
|
||||
'colPrefix': 'c',
|
||||
'tagPrefix': 't',
|
||||
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||
|
@ -188,7 +188,10 @@ class TDTestCase:
|
|||
|
||||
tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||
tdSql.query("show stables")
|
||||
tdSql.checkRows(allStbNumbers)
|
||||
tdLog.debug("we find %d stables but exepect to create %d stables "%(tdSql.queryRows,allStbNumbers))
|
||||
# # tdLog.info("check Stable Rows:")
|
||||
# tdSql.checkRows(allStbNumbers)
|
||||
|
||||
|
||||
|
||||
def run(self):
|
||||
|
|
|
@ -68,7 +68,7 @@ class TDTestCase:
|
|||
def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole):
|
||||
tdLog.printNoPrefix("======== test case 1: ")
|
||||
paraDict = {'dbName': 'db',
|
||||
'dbNumbers': 10,
|
||||
'dbNumbers': 8,
|
||||
'dropFlag': 1,
|
||||
'event': '',
|
||||
'vgroups': 2,
|
||||
|
|
|
@ -98,7 +98,7 @@ class TDTestCase:
|
|||
'vgroups': 4,
|
||||
'replica': 1,
|
||||
'stbName': 'stb',
|
||||
'stbNumbers': 100,
|
||||
'stbNumbers': 80,
|
||||
'colPrefix': 'c',
|
||||
'tagPrefix': 't',
|
||||
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||
|
@ -142,7 +142,8 @@ class TDTestCase:
|
|||
threads=[]
|
||||
for i in range(restartNumbers):
|
||||
stableName= '%s%d'%(paraDict['stbName'],i)
|
||||
threads.append(threading.Thread(target=clusterComCreate.create_stables, args=(tdSql, paraDict["dbName"],stableName,paraDict['stbNumbers'])))
|
||||
newTdSql=tdCom.newTdSql()
|
||||
threads.append(threading.Thread(target=clusterComCreate.create_stables, args=(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers'])))
|
||||
|
||||
for tr in threads:
|
||||
tr.start()
|
||||
|
@ -190,6 +191,7 @@ class TDTestCase:
|
|||
tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||
tdSql.query("show stables")
|
||||
tdLog.debug("we find %d stables but exepect to create %d stables "%(tdSql.queryRows,allStbNumbers))
|
||||
# # tdLog.info("check Stable Rows:")
|
||||
# tdSql.checkRows(allStbNumbers)
|
||||
|
||||
|
||||
|
|
|
@ -159,19 +159,19 @@ class TDTestCase:
|
|||
for tr in threads:
|
||||
tr.join()
|
||||
clusterComCheck.checkDnodes(dnodeNumbers)
|
||||
tdSql.query("show databases")
|
||||
tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers))
|
||||
# tdSql.query("show databases")
|
||||
# tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers))
|
||||
|
||||
# # tdLog.info("check DB Rows:")
|
||||
# clusterComCheck.checkDbRows(allDbNumbers)
|
||||
# # tdLog.info("check DB Status on by on")
|
||||
# tdLog.info("check DB Rows:")
|
||||
clusterComCheck.checkDbRows(allDbNumbers)
|
||||
# tdLog.info("check DB Status on by on")
|
||||
# for i in range(restartNumbers):
|
||||
# clusterComCheck.checkDb(paraDict['dbNumbers'],restartNumbers,dbNameIndex = '%s%d'%(paraDict["dbName"],i))
|
||||
|
||||
|
||||
def run(self):
|
||||
# print(self.master_dnode.cfgDict)
|
||||
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=15,stopRole='vnode')
|
||||
self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=10,stopRole='vnode')
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -98,7 +98,7 @@ class TDTestCase:
|
|||
'vgroups': 4,
|
||||
'replica': 1,
|
||||
'stbName': 'stb',
|
||||
'stbNumbers': 100,
|
||||
'stbNumbers': 80,
|
||||
'colPrefix': 'c',
|
||||
'tagPrefix': 't',
|
||||
'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}],
|
||||
|
@ -192,6 +192,8 @@ class TDTestCase:
|
|||
|
||||
tdSql.execute("use %s" %(paraDict["dbName"]))
|
||||
tdSql.query("show stables")
|
||||
tdLog.debug("we find %d stables but exepect to create %d stables "%(tdSql.queryRows,allStbNumbers))
|
||||
# # tdLog.info("check Stable Rows:")
|
||||
tdSql.checkRows(allStbNumbers)
|
||||
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class TDTestCase:
|
|||
|
||||
def run(self):
|
||||
# print(self.master_dnode.cfgDict)
|
||||
self.fiveDnodeThreeMnode(5,3,1)
|
||||
self.fiveDnodeThreeMnode(dnodenumbers=5,mnodeNums=3,restartNumber=1)
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -63,6 +63,7 @@ class ClusterComCheck:
|
|||
count=0
|
||||
while count < 5:
|
||||
tdSql.query("show databases;")
|
||||
count+=1
|
||||
if tdSql.checkRows(dbNumbers+2):
|
||||
tdLog.success("we find %d databases and expect %d in clusters! " %(tdSql.queryRows,dbNumbers+2))
|
||||
return True
|
||||
|
|
|
@ -152,15 +152,17 @@ python3 ./test.py -f 2-query/max_partition.py
|
|||
python3 ./test.py -f 2-query/last_row.py
|
||||
|
||||
python3 ./test.py -f 6-cluster/5dnode1mnode.py
|
||||
#python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3
|
||||
#python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3
|
||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3
|
||||
python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3
|
||||
|
||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3
|
||||
|
||||
# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py
|
||||
# python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5
|
||||
# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3
|
||||
|
|
Loading…
Reference in New Issue