test: update the test cases.

This commit is contained in:
Haojun Liao 2024-07-24 00:27:22 +08:00
parent cd000ba981
commit 9bfb0603d8
2 changed files with 9 additions and 3 deletions

View File

@ -539,9 +539,11 @@ void streamMetaClear(SStreamMeta* pMeta) {
streamMetaReleaseTask(pMeta, p); streamMetaReleaseTask(pMeta, p);
} }
int32_t code = taosRemoveRef(streamBackendId, pMeta->streamBackendRid); if (pMeta->streamBackendRid != 0) {
if (code) { int32_t code = taosRemoveRef(streamBackendId, pMeta->streamBackendRid);
stError("vgId:%d remove stream backend Ref failed, rid:%"PRId64, pMeta->vgId, pMeta->streamBackendRid); if (code) {
stError("vgId:%d remove stream backend Ref failed, rid:%" PRId64, pMeta->vgId, pMeta->streamBackendRid);
}
} }
taosHashClear(pMeta->pTasksMap); taosHashClear(pMeta->pTasksMap);

View File

@ -67,11 +67,15 @@ class TDTestCase:
tdSql.execute(f'use {self.dbname}') tdSql.execute(f'use {self.dbname}')
tdSql.execute(f'create stable {self.stbname} (ts timestamp,c0 int) tags(t0 int)') tdSql.execute(f'create stable {self.stbname} (ts timestamp,c0 int) tags(t0 int)')
tdSql.execute(f'create stream `{self.streamname}` into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);') tdSql.execute(f'create stream `{self.streamname}` into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);')
time.sleep(15)
tdSql.query('show streams') tdSql.query('show streams')
tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname) tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname)
tdSql.execute(f'drop stream {self.streamname}') tdSql.execute(f'drop stream {self.streamname}')
tdSql.execute(f'drop stable {self.streamtb}') tdSql.execute(f'drop stable {self.streamtb}')
tdSql.execute(f'create stream {self.streamname} into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);') tdSql.execute(f'create stream {self.streamname} into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);')
time.sleep(10)
tdSql.query('show streams') tdSql.query('show streams')
tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname) tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname)
tdSql.execute(f'drop stream `{self.streamname}`') tdSql.execute(f'drop stream `{self.streamname}`')