Skip to content

Commit 44ae042

Browse files
author
release
committed
Merge branch 'release130.21' into release130.22
2 parents 25a9a6a + b92ab60 commit 44ae042

7 files changed

+39
-15
lines changed
595 KB
Binary file not shown.

test/IPCinMemoryTableTest_gtest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ int insertTask(int insertNum, int sleepMS)
4848
{
4949
DBConnection connNew(false, false);
5050
connNew.connect(hostName, port, "admin", "123456");
51-
connNew.run("for (i in 1.." + to_string(insertNum) + "){tableInsert(pubTable,rand(1..100,1),norm(2,0.4,1),take(now(true),1));sleep(" + to_string(sleepMS) + ")}");
51+
for(auto i =0;i<insertNum;i++)
52+
connNew.run("tableInsert(pubTable,rand(1..100,1),norm(2,0.4,1),take(now(true),1));sleep(" + to_string(sleepMS) + ")");
5253
connNew.close();
5354
cout << "insert finished!" << endl;
5455
return 0;

test/StreamingPollingClientTester_gtest.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,26 @@ namespace SPCT
4040
string del_streamtable = "login(\"admin\",\"123456\");"
4141
"try{ dropStreamTable(`outTables);}catch(ex){};"
4242
"try{ dropStreamTable(`st1);}catch(ex){};"
43-
"try{ dropStreamTable(`arrayVectorTable);}catch(ex){};";
43+
"try{ dropStreamTable(`arrayVectorTable);}catch(ex){};go;sleep(1000)";
4444
conn.run(del_streamtable);
4545
}
4646
virtual void TearDown()
4747
{
48-
conn.run("undef all;");
48+
string del_streamtable = "login(\"admin\",\"123456\");"
49+
"try{ dropStreamTable(`outTables);}catch(ex){};"
50+
"try{ dropStreamTable(`st1);}catch(ex){};"
51+
"try{ dropStreamTable(`arrayVectorTable);}catch(ex){};go;sleep(1000)";
52+
conn.run(del_streamtable);
53+
Util::sleep(1000);
54+
// conn.run("undef all;");
4955
}
5056
};
5157

5258
static void createSharedTableAndReplay(int rows)
5359
{
5460
string script = "login(\"admin\",\"123456\")\n\
5561
st1 = streamTable(100:0, `datetimev`timestampv`sym`price1`price2,[DATETIME,TIMESTAMP,SYMBOL,DOUBLE,DOUBLE])\n\
56-
enableTableShareAndPersistence(table=st1, tableName=`outTables, asynWrite=true, compress=true, cacheSize=200000, retentionMinutes=180, preCache = 0)\n\
62+
enableTableShareAndPersistence(table=st1, tableName=`outTables)\n\
5763
go\n\
5864
setStreamTableFilterColumn(outTables, `sym)";
5965
conn.run(script);
@@ -73,7 +79,7 @@ namespace SPCT
7379
"colType = [BOOL, CHAR, SHORT, INT,LONG, DATE, MONTH, TIME, MINUTE, SECOND, DATETIME, TIMESTAMP, NANOTIME, NANOTIMESTAMP, FLOAT, DOUBLE, SYMBOL, STRING, BLOB, IPADDR, UUID, INT128, DECIMAL32(" +
7480
to_string(scale32) + "), DECIMAL64(" + to_string(scale64) + ")];"
7581
"st1 = streamTable(100:0,colName, colType);"
76-
"enableTableShareAndPersistence(table=st1, tableName=`outTables, asynWrite=true, compress=true, cacheSize=200000, retentionMinutes=180, preCache = 0);go;"
82+
"enableTableShareAndPersistence(table=st1, tableName=`outTables);go;"
7783
"setStreamTableFilterColumn(outTables, `csymbol);go;"
7884
"row_num = 1000;"
7985
"table1_SPCT = table(100:0, colName, colType);"
@@ -93,7 +99,7 @@ namespace SPCT
9399
string replayScript = "colName = `ts`cbool`cchar`cshort`cint`clong`cdate`cmonth`ctime`cminute`csecond`cdatetime`ctimestamp`cnanotime`cnanotimestamp`cfloat`cdouble`cipaddr`cuuid`cint128;"
94100
"colType = [TIMESTAMP,BOOL[], CHAR[], SHORT[], INT[],LONG[], DATE[], MONTH[], TIME[], MINUTE[], SECOND[], DATETIME[], TIMESTAMP[], NANOTIME[], NANOTIMESTAMP[], FLOAT[], DOUBLE[], IPADDR[], UUID[], INT128[]];"
95101
"st1 = streamTable(100:0,colName, colType);"
96-
"enableTableShareAndPersistence(table=st1, tableName=`arrayVectorTable, asynWrite=true, compress=true, cacheSize=200000, retentionMinutes=180, preCache = 0);go;"
102+
"enableTableShareAndPersistence(table=st1, tableName=`arrayVectorTable);go;"
97103
"row_num = 1000;"
98104
"table1_SPCT = table(100:0, colName, colType);"
99105
"col0=rand(0..row_num ,row_num);col1 = arrayVector(1..row_num,rand(2 ,row_num));col2 = arrayVector(1..row_num,rand(256 ,row_num));col3 = arrayVector(1..row_num,rand(-row_num..row_num ,row_num));"

test/StreamingSubscribeHAstreamTableTest_gtest.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class StreamingSubscribeHighAvailableTest : public testing::Test, public ::testi
4444
string createHAstreamTable = "try{dropStreamTable(`tradesHA);}catch(ex){};go;\
4545
colNames = `timestamp`sym`qty`price;\
4646
colTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE];\
47-
t=table(100:0,colNames,colTypes);\
47+
t=table(2000:0,colNames,colTypes);\
4848
haStreamTable(" +
4949
raftsGroup + ",t,`tradesHA,100000);sleep(1000);";
5050
conn.run(createHAstreamTable);
5151
}
5252
}
5353
virtual void TearDown()
5454
{
55-
conn.run("undef all;");
55+
conn.run("try{dropStreamTable(`tradesHA);}catch(ex){};go;undef all;");
5656
}
5757
};
5858

@@ -145,7 +145,8 @@ void insert_task(string host, int port, int totalInsertNum)
145145
DBConnection conn_1;
146146
conn_1.connect(host, port, "admin", "123456", "", true, sites);
147147
cout << "insert datas to HAstreamtable..." << endl;
148-
conn_1.run("for (i in 1.." + to_string(totalInsertNum) + "){tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1));}");
148+
for(auto i =0;i<totalInsertNum;i++)
149+
ASSERT_TRUE(conn_1.run("tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1))")->getBool());
149150
cout << "insert finished!" << endl;
150151
Util::sleep(1000);
151152
conn_1.close();
@@ -263,7 +264,8 @@ TEST_P(StreamingSubscribeHighAvailableTest, test_Threadclient_onehandler_subscri
263264
t=table(100:0,colNames,colTypes);\
264265
haStreamTable(" +
265266
raftsGroup + ",t,`tradesHA,100000);sleep(1000);go");
266-
conn_1.run("for (i in 1.." + to_string(insert_total_rows) + "){tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1));}");
267+
for(auto i =0;i<insert_total_rows;i++)
268+
conn_1.run("tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1))");
267269
cout << "insert finished!" << endl;
268270
Util::sleep(1000);
269271
conn_1.close(); });
@@ -443,7 +445,8 @@ TEST_P(StreamingSubscribeHighAvailableTest, test_Pollingclient_subscribeStreamTa
443445
t=table(100:0,colNames,colTypes);\
444446
haStreamTable(" +
445447
raftsGroup + ",t,`tradesHA,100000);sleep(1000);go");
446-
conn_1.run("for (i in 1.." + to_string(insert_total_rows) + "){tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1));}");
448+
for(auto i =0;i<insert_total_rows;i++)
449+
conn_1.run("tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1))");
447450
cout << "insert finished!" << endl;
448451
Util::sleep(1000);
449452
conn_1.close(); });
@@ -591,7 +594,8 @@ TEST_P(StreamingSubscribeHighAvailableTest, test_Threadpooledclient_threadCount_
591594
t=table(100:0,colNames,colTypes);\
592595
haStreamTable(" +
593596
raftsGroup + ",t,`tradesHA,100000);sleep(1000);go");
594-
conn_1.run("for (i in 1.." + to_string(insert_total_rows) + "){tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1));}");
597+
for(auto i =0;i<insert_total_rows;i++)
598+
conn_1.run("tableInsert(`tradesHA,rand(timestamp(10000)..timestamp(20000),1),rand(`a`b`c`d,1),rand(1000,1),rand(100.00,1))");
595599
cout << "insert finished!" << endl;
596600
Util::sleep(1000);
597601
conn_1.close(); });

test/StreamingThreadPooledClientTester_gtest.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ namespace STPCT
4545
}
4646
virtual void TearDown()
4747
{
48-
conn.run("undef all;");
48+
string del_streamtable = "login(\"admin\",\"123456\");"
49+
"try{ dropStreamTable(`outTables);}catch(ex){};"
50+
"try{ dropStreamTable(`st1);}catch(ex){};"
51+
"try{ dropStreamTable(`arrayVectorTable);}catch(ex){};";
52+
conn.run(del_streamtable+"go;undef all;");
4953
}
5054
};
5155

test/StreamingThreadedClientTester_gtest.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ namespace STCT
4545
}
4646
virtual void TearDown()
4747
{
48-
conn.run("undef all;");
48+
string del_streamtable = "login(\"admin\",\"123456\");"
49+
"try{ dropStreamTable(`outTables);}catch(ex){};"
50+
"try{ dropStreamTable(`st1);}catch(ex){};"
51+
"try{ dropStreamTable(`arrayVectorTable);}catch(ex){};";
52+
conn.run(del_streamtable+"go;undef all;");
4953
}
5054
};
5155

test/streamingDeserilizerTester_gtest.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ class StreamingDeserilizerTester : public ::testing::Test, public ::testing::Wit
4545
}
4646
virtual void TearDown()
4747
{
48-
conn.run("undef all;");
48+
string del_streamtable = "login(\"admin\",\"123456\");"
49+
"try{ dropStreamTable(`SDoutTables);}catch(ex){};"
50+
"try{ dropStreamTable(`st2);}catch(ex){};"
51+
"try{ dropStreamTable(`table1_SDPT);}catch(ex){};"
52+
"try{ dropStreamTable(`table2_SDPT);}catch(ex){};";
53+
conn.run(del_streamtable+"go;undef all;");
4954
}
5055
};
5156

0 commit comments

Comments
 (0)