Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ca52c9e8
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ca52c9e8
编写于
3月 18, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.4' into feature/TD-13970-2.4
上级
e5683608
00fc39e8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
92 addition
and
0 deletion
+92
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+2
-0
tests/pytest/update/update2.py
tests/pytest/update/update2.py
+90
-0
未找到文件。
tests/parallel_test/cases.task
浏览文件 @
ca52c9e8
...
...
@@ -745,3 +745,5 @@
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 1-insert/uppercase_in_stmt.py
3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py
8,,pytest,python3 test.py -f update/update2.py
4,,pytest,python3 test.py -f insert/line_insert.py
tests/pytest/update/update2.py
0 → 100644
浏览文件 @
ca52c9e8
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
import
random
import
datetime
import
threading
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
lock
=
threading
.
RLock
()
self
.
ts
=
[]
def
restartTaosd
(
self
):
tdDnodes
.
stop
(
1
)
tdDnodes
.
startWithoutSleep
(
1
)
tdSql
.
execute
(
"use db"
)
def
insertData
(
self
):
self
.
lock
.
acquire
()
try
:
sql
=
"insert into test2.warning_1 values "
for
i
in
range
(
10
):
ct
=
datetime
.
datetime
.
now
()
t
=
int
(
ct
.
timestamp
()
*
1000
)
self
.
ts
.
append
(
t
)
wait
=
random
.
randint
(
1
,
9
)
time
.
sleep
(
0.0001
*
wait
)
sql
+=
"(%d, %d, 0, 0, 0, %d, 0, %f, %f, 0, 0, %d, %d, False, 0, '', '', 0, False, %d)"
%
(
t
,
random
.
randint
(
0
,
20
),
random
.
randint
(
1
,
10000
),
random
.
uniform
(
0
,
1
),
random
.
uniform
(
0
,
1
),
random
.
randint
(
1
,
10000
),
random
.
randint
(
1
,
10000
),
t
)
tdSql
.
execute
(
sql
)
finally
:
self
.
lock
.
release
()
def
updateData
(
self
):
self
.
lock
.
acquire
()
try
:
sql
=
"insert into test2.warning_1(ts,endtime,maxspeed,endlongitude,endlatitude,drivercard_id,status,endmileage) values "
for
t
in
self
.
ts
:
sql
+=
"(%d, %d, 0, %f, %f, 0, False, %d)"
%
(
t
,
t
,
random
.
uniform
(
0
,
1
),
random
.
uniform
(
0
,
1
),
random
.
randint
(
1
,
10000
))
tdSql
.
execute
(
sql
)
self
.
ts
.
clear
()
finally
:
self
.
lock
.
release
()
def
run
(
self
):
tdSql
.
execute
(
"CREATE DATABASE test2 CACHE 1 BLOCKS 3 UPDATE 2"
)
tdSql
.
execute
(
"use test2"
)
tdSql
.
execute
(
'''CREATE TABLE test2.fx_car_warning (ts TIMESTAMP, type TINYINT, level TINYINT, origin TINYINT, endtime BIGINT, mileage INT, maxspeed DOUBLE,
longitude DOUBLE, latitude DOUBLE, endlongitude DOUBLE, endlatitude DOUBLE, drivercard_id BIGINT, infoid INT, status BOOL, endmileage INT,
duty_officer NCHAR(10), content NCHAR(100), cltime BIGINT, clstatus BOOL, starttime BIGINT) TAGS (catid BIGINT, car_id BIGINT, mytype TINYINT)'''
)
tdSql
.
execute
(
"create table test2.warning_1 using test2.fx_car_warning tags(1, 1, 0)"
)
tdLog
.
sleep
(
1
)
for
i
in
range
(
1000
):
t1
=
threading
.
Thread
(
target
=
self
.
insertData
,
args
=
(
))
t2
=
threading
.
Thread
(
target
=
self
.
updateData
,
args
=
(
))
t1
.
start
()
t2
.
start
()
t1
.
join
()
t2
.
join
()
tdSql
.
query
(
"select * from test2.fx_car_warning where type is null"
)
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录