diff --git a/tests/pytest/manualTest/manual_alter_block.py b/tests/pytest/manualTest/manual_alter_block.py index 0db74e160a0e7f377ef92893c025bdc17f817da7..ccd98b1421400a765d85a35cf3a0b13b15f35f8e 100644 --- a/tests/pytest/manualTest/manual_alter_block.py +++ b/tests/pytest/manualTest/manual_alter_block.py @@ -17,7 +17,8 @@ from util.cases import * from util.sql import * from util.dnodes import tdDnodes - +##TODO: auto test version is currently unsupported, need to come up with +# an auto test version in the future class TDTestCase: def init(self, conn, logSql): tdLog.debug("start to execute %s" % __file__) @@ -48,27 +49,33 @@ class TDTestCase: tdLog.info("taosd found in %s" % buildPath) binPath = buildPath+ "/build/bin/" + #alter cache block to 3, then check alter tdSql.execute('alter database db blocks 3') tdSql.query('show databases') tdSql.checkData(0,9,3) - os.system("%staosdemo -f tools/taosdemoAllTest/insert_5Mrows_noTB.json" % binPath) - + #run taosdemo to occupy all cache, need to manually check memory consumption + os.system("%staosdemo -f tools/taosdemoAllTest/manual_block1_comp.json" % binPath) input("please check memory usage for taosd. After checking, press enter") + #alter cache block to 8, then check alter tdSql.execute('alter database db blocks 8') tdSql.query('show databases') tdSql.checkData(0,9,8) - tdDnodes.stop(1) - tdDnodes.start(1) - - os.system("%staosdemo -f tools/taosdemoAllTest/insert_5Mrows_hasTB.json" % binPath) + #run taosdemo to occupy all cache, need to manually check memory consumption + os.system("%staosdemo -f tools/taosdemoAllTest/manual_block2.json" % binPath) input("please check memory usage for taosd. After checking, press enter") + ##expected result the peak memory consumption should increase by around 80MB = 5 blocks of cache + + ##test results + #2021/06/02 before:2621700K after: 2703640K memory usage increased by 80MB = 5 block + # confirm with the change in block. Baosheng Chang + def stop(self): tdSql.close() - tdLog.success("%s successfully executed" % __file__) + tdLog.debug("%s alter block manual check finish" % __file__) tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/pytest/tools/taosdemoAllTest/insert_5Mrows_noTB.json b/tests/pytest/tools/taosdemoAllTest/manual_block1_comp.json similarity index 84% rename from tests/pytest/tools/taosdemoAllTest/insert_5Mrows_noTB.json rename to tests/pytest/tools/taosdemoAllTest/manual_block1_comp.json index 8583b9a897fbddbcbc88f31db52f8b9e80f37ea1..3ced8272b290bfd8bb98c9a78f3892c1b298a45e 100644 --- a/tests/pytest/tools/taosdemoAllTest/insert_5Mrows_noTB.json +++ b/tests/pytest/tools/taosdemoAllTest/manual_block1_comp.json @@ -22,7 +22,7 @@ "blocks": 3, "precision": "ms", "keep": 3650, - "minRows": 100, + "minRows": 1000, "maxRows": 4096, "comp":2, "walLevel":1, @@ -40,7 +40,7 @@ "batch_create_tbl_num": 20, "data_source": "rand", "insert_mode": "taosc", - "insert_rows": 100000, + "insert_rows": 10000, "childtable_limit": 10, "childtable_offset":100, "interlace_rows": 0, @@ -53,8 +53,8 @@ "sample_format": "csv", "sample_file": "./sample.csv", "tags_file": "", - "columns": [{"type": "INT"}], - "tags": [{"type": "TINYINT", "count":2}] + "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}], + "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":5}] }] }] } \ No newline at end of file diff --git a/tests/pytest/tools/taosdemoAllTest/insert_5Mrows_hasTB.json b/tests/pytest/tools/taosdemoAllTest/manual_block2.json similarity index 98% rename from tests/pytest/tools/taosdemoAllTest/insert_5Mrows_hasTB.json rename to tests/pytest/tools/taosdemoAllTest/manual_block2.json index 2731e0505ce730f50784fe780f816609f52479ea..434159159b4dfe942af1c334fd9520d81214e6cb 100644 --- a/tests/pytest/tools/taosdemoAllTest/insert_5Mrows_hasTB.json +++ b/tests/pytest/tools/taosdemoAllTest/manual_block2.json @@ -19,7 +19,7 @@ "replica": 1, "days": 10, "cache": 16, - "blocks": 3, + "blocks": 8, "precision": "ms", "keep": 3650, "minRows": 100,