Increase stack depth for PR fault_injection tests (#3489)

* increase stack depth for PR fault_injection tests

* fix memleak in unit tests

---------

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Anurag Saxena 2024-04-25 11:05:16 -07:00 коммит произвёл GitHub
Родитель db14b8209d
Коммит fa003d8650
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 15 добавлений и 9 удалений

2
.github/workflows/reusable-test.yml поставляемый
Просмотреть файл

@ -221,7 +221,7 @@ jobs:
shell: cmd
run: |
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell.exe .\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}} 4
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell.exe .\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}} 8
- name: Run test with low resource simulation
if: (inputs.code_coverage != true) && (inputs.fault_injection == true) && (steps.skip_check.outputs.should_skip != 'true')

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

@ -2946,6 +2946,7 @@ extension_reload_test(ebpf_execution_type_t execution_type)
bpf_object_ptr unique_test_sample_ebpf_object;
int program_fd = -1;
const char* error_message = nullptr;
int result;
// Should fail.
REQUIRE(
@ -2966,14 +2967,19 @@ extension_reload_test(ebpf_execution_type_t execution_type)
program_info_provider_t sample_program_info;
REQUIRE(sample_program_info.initialize(EBPF_PROGRAM_TYPE_SAMPLE) == EBPF_SUCCESS);
REQUIRE(
ebpf_program_load(
execution_type == EBPF_EXECUTION_NATIVE ? "test_sample_ebpf_um.dll" : "test_sample_ebpf.o",
BPF_PROG_TYPE_UNSPEC,
execution_type,
&unique_test_sample_ebpf_object,
&program_fd,
&error_message) == 0);
result = ebpf_program_load(
execution_type == EBPF_EXECUTION_NATIVE ? "test_sample_ebpf_um.dll" : "test_sample_ebpf.o",
BPF_PROG_TYPE_UNSPEC,
execution_type,
&unique_test_sample_ebpf_object,
&program_fd,
&error_message);
if (error_message) {
printf("ebpf_program_load failed with %s\n", error_message);
ebpf_free((void*)error_message);
}
REQUIRE(result == 0);
bpf_link* link = nullptr;
// Attach only to the single interface being tested.