Correctly unwind async state on failure (#1556)

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
This commit is contained in:
Alan Jowett 2022-11-02 17:16:57 -06:00 коммит произвёл GitHub
Родитель ee8da616b7
Коммит acb1d4373d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -738,7 +738,11 @@ TEST_CASE("ring_buffer_async_query", "[execution_context]")
REQUIRE(result == EBPF_SUCCESS);
}) == EBPF_SUCCESS);
REQUIRE(ebpf_ring_buffer_map_async_query(map.get(), &completion.async_query_result, &completion) == EBPF_PENDING);
ebpf_result_t result = ebpf_ring_buffer_map_async_query(map.get(), &completion.async_query_result, &completion);
if (result != EBPF_PENDING) {
ebpf_async_reset_completion_callback(&completion);
}
REQUIRE(result == EBPF_PENDING);
uint64_t value = 1;
REQUIRE(ebpf_ring_buffer_map_output(map.get(), reinterpret_cast<uint8_t*>(&value), sizeof(value)) == EBPF_SUCCESS);
@ -1004,10 +1008,10 @@ extern bool _ebpf_platform_code_integrity_enabled;
#define NEGATIVE_TEST_PROLOG() \
std::vector<std::unique_ptr<_program_info_provider>> program_info_providers; \
_ebpf_core_initializer core; \
for (const auto& type : _program_types) { \
program_info_providers.push_back(std::make_unique<_program_info_provider>(type)); \
} \
_ebpf_core_initializer core; \
std::vector<ebpf_handle_t> program_handles; \
std::map<std::string, ebpf_handle_t> map_handles; \
create_various_objects(program_handles, map_handles);