/* Abort an essential thread. 
The kernel shall raise a fatal system error if an essential thread aborts, implement k_sys_fatal_error_handler to handle this error. */
ZTEST(threads_lifecycle, test_essential_thread_abort)
/* Abort an essential thread. 
The kernel shall raise a fatal system error if an essential thread aborts, implement k_sys_fatal_error_handler to handle this error. */
ZTEST(threads_lifecycle, test_essential_thread_abort)
{
	k_tid_t tid = k_thread_create(&kthread_thread1, kthread_stack, STACKSIZE,
				      abort_thread_entry,
				      NULL, NULL, NULL, K_PRIO_PREEMPT(0), 0,
				      K_NO_WAIT);
	k_sem_take(&sync_sem, K_FOREVER);
	k_thread_abort(tid);
	zassert_true(fatal_error_signaled, "fatal error was not signaled");
}