未验证 提交 f6821f30 编写于 作者: O openharmony_ci 提交者: Gitee

!7121 faultlogger测试用例内存泄漏问题修复

Merge pull request !7121 from chenxuihui/master
......@@ -17,24 +17,13 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
export default function BytraceTest() {
describe("BytraceTest", function () {
async function msleep(time) {
var promise = new Promise((resolve, reject) => {
setTimeout(() => resolve("done!"), time);
});
var result = await promise;
}
it("DFX_DFR_Bytrace_0100", 0, async function (done) {
console.info("-------DFX_DFR_Bytrace_0100 start--------");
await msleep(3000);
for (var i = 0; i < 3; i++) {
console.info("DFX_DFR_Bytrace_0100 i = " + i)
console.info("DFX_DFR_Bytrace_0100 " + i.toString() + " startTrace start");
bytrace.startTrace("test-" + i.toString(), 111 + i, 5000);
console.info("DFX_DFR_Bytrace_0100 " + i.toString() + "startTrace end");
// await msleep(3000);
console.info("DFX_DFR_Bytrace_0100 " + i.toString() + " finishTrace start");
bytrace.finishTrace("test-" + i.toString(), 111 + i);
console.info("DFX_DFR_Bytrace_0100 " + i.toString() + "finishTrace end");
......@@ -155,7 +144,6 @@ describe("BytraceTest", function () {
for (var i = 0; i < 3; i++) {
console.info("DFX_DFR_Bytrace_0400 :" + i);
bytrace.traceByValue("test4-" + i.toString(), 3 + i);
await msleep(1000);
}
console.info("DFX_DFR_Bytrace_0400 end");
done();
......
......@@ -17,16 +17,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
export default function HitraceMeterTest() {
describe("HitraceMeterTest", function () {
async function msleep(time) {
var promise = new Promise((resolve, reject) => {
setTimeout(() => resolve("done!"), time);
});
var result = await promise;
}
it("DFX_DFR_HitraceMeter_0100", 0, async function (done) {
console.info("-------DFX_DFR_HitraceMeter_0100 start--------");
await msleep(3000);
for (var i = 0; i < 3; i++) {
console.info("DFX_DFR_HitraceMeter_0100 i = " + i)
console.info("DFX_DFR_HitraceMeter_0100 " + i.toString() + " startTrace start");
......@@ -152,7 +144,6 @@ describe("HitraceMeterTest", function () {
for (var i = 0; i < 3; i++) {
console.info("DFX_DFR_HitraceMeter_0400 :" + i);
hiTraceMeter.traceByValue("test4-" + i.toString(), 3 + i);
await msleep(1000);
}
console.info("DFX_DFR_HitraceMeter_0400 end");
done();
......
......@@ -35,10 +35,12 @@ describe("FaultlogJsTest", function () {
})
async function msleep(time) {
let timeoutID = null;
let promise = new Promise((resolve, reject) => {
setTimeout(() => resolve("done!"), time)
timeoutID = setTimeout(() => resolve("done!"), time)
});
let result = await promise;
clearTimeout(timeoutID);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册