cxx tests: Fix race condition w/ leak checker when tearing down test tasks
This commit is contained in:
parent
90bf40587e
commit
2ccc2ec5ee
1 changed files with 2 additions and 1 deletions
|
@ -92,7 +92,6 @@ public:
|
||||||
static SlowInit slowinit(taskId);
|
static SlowInit slowinit(taskId);
|
||||||
ESP_LOGD(TAG, "obj=%d after static init, task=%d\n", obj, taskId);
|
ESP_LOGD(TAG, "obj=%d after static init, task=%d\n", obj, taskId);
|
||||||
xSemaphoreGive(s_slow_init_sem);
|
xSemaphoreGive(s_slow_init_sem);
|
||||||
vTaskDelay(10);
|
|
||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
@ -133,6 +132,8 @@ TEST_CASE("static initialization guards work as expected", "[cxx]")
|
||||||
TEST_ASSERT_TRUE(xSemaphoreTake(s_slow_init_sem, 500/portTICK_PERIOD_MS));
|
TEST_ASSERT_TRUE(xSemaphoreTake(s_slow_init_sem, 500/portTICK_PERIOD_MS));
|
||||||
}
|
}
|
||||||
vSemaphoreDelete(s_slow_init_sem);
|
vSemaphoreDelete(s_slow_init_sem);
|
||||||
|
|
||||||
|
vTaskDelay(10); // Allow tasks to clean up, avoids race with leak detector
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GlobalInitTest
|
struct GlobalInitTest
|
||||||
|
|
Loading…
Reference in a new issue