Add test to prevent re-running tasks in Nanos6

For now is disabled until we have a better instrumentation for task
states.
This commit is contained in:
Rodrigo Arias 2023-04-14 11:10:44 +02:00 committed by Rodrigo Arias Mallo
parent bc513832a5
commit 4a936dcb99
2 changed files with 34 additions and 0 deletions

View File

@ -13,3 +13,8 @@ test_emu(switch-same-type.c)
test_emu(sponge.c) test_emu(sponge.c)
test_emu(sponge-breakdown.c BREAKDOWN) test_emu(sponge-breakdown.c BREAKDOWN)
test_emu(breakdown-no-black.c BREAKDOWN) test_emu(breakdown-no-black.c BREAKDOWN)
# FIXME: Disabled to support the taskiter in NODES until we have more detailed
# task states instrumentation.
test_emu(rerun-task-bad.c DISABLED SHOULD_FAIL
REGEX "task_execute: cannot execute task [0-9]\\+: state is not created")

View File

@ -0,0 +1,29 @@
/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include <stdint.h>
#include "instr.h"
#include "instr_nanos6.h"
/* Ensure a Nanos6 task cannot be executed again after ending. */
int
main(void)
{
instr_start(0, 1);
uint32_t typeid = 666;
instr_nanos6_type_create(typeid);
uint32_t taskid = 1;
instr_nanos6_task_create_and_execute(taskid, typeid);
instr_nanos6_task_end(taskid);
/* Run again the same task (should fail) */
instr_nanos6_task_execute(taskid);
instr_nanos6_task_end(taskid);
instr_end();
return 0;
}