Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP#621
Convert all tests to use TIMED_TEST_SUITE_INITIALIZE/CLEANUP#621parth21999 wants to merge 21 commits into
Conversation
- Update c-pal submodule to latest master (with timed test suite support) - Replace TEST_SUITE_INITIALIZE/CLEANUP with TIMED_ versions in 65 test files - Add c_pal/timed_test_suite.h to 49 PCH files and 17 int test files - Add real_process_watchdog and c_pal to UT CMakeLists - Add c_pal to int test CMakeLists Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
The process watchdog uses POSIX timer_create(SIGEV_THREAD) which spawns a helper thread that valgrind flags as a possible memory leak during timer_delete cleanup. This is a known false positive. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| fun:pthread_create@@GLIBC_* | ||
| fun:timer_helper_thread | ||
| fun:start_thread | ||
| } |
There was a problem hiding this comment.
why is this needed? #Resolved
There was a problem hiding this comment.
The timer code on linux creates a false positive on helgrind. This is documented in c-pal.
TIMED_TEST_SUITE brings in the timer in c_util, so c_util also needs the suppression now.
|
|
||
| build_test_artifacts(${theseTestsName} "tests/c_util" | ||
| ADDITIONAL_LIBS c_pal c_pal_reals | ||
| ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals |
There was a problem hiding this comment.
Proabably because the UT did not rename interlocked_ symbols to real_ versions.
It is a pre-existing issue. I tried removing it and compiler complains.
Added: https://msazure.visualstudio.com/DefaultCollection/One/_workitems/edit/38360022
I also created a separate real_process_watchdog lib for including the process watchdog, so the entire c-pal doesn't need to be linked because TIMED_TEST_SUITE needs it.
|
|
||
| build_test_artifacts(${theseTestsName} "tests/c_util" | ||
| ADDITIONAL_LIBS c_util c_pal_reals | ||
| ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals |
There was a problem hiding this comment.
Removed c_pal from here. c_util is pre-existing.
| #include "c_pal/interlocked.h" | ||
| #include "c_pal/interlocked_hl.h" | ||
| #include "c_pal/sync.h" | ||
| #include "c_pal/timed_test_suite.h" |
There was a problem hiding this comment.
There was a problem hiding this comment.
c-pal provides the process_watchdog that runs a timer to collect a dump if the test hangs.
There was a problem hiding this comment.
There was a fair bit of discussion regarding where process_watchdog should be placed. It was finally decided that c-pal is the correct repo for it.
Since the TIMED_TEST_SUITE macros need the process_watchdog, they must also sit in c-pal.
…... (#625) Dependency updates: c-build-tools: - ceb07ab Propagation script: resume, autofix, and resilience improvements (Azure/c-build-tools#382)
…... (#626) Dependency updates: c-build-tools: - 6cc58a1 CETCOMAT is not ARM64 compatible (Azure/c-build-tools#396)
…#627) Dependency updates: azure-messaging-ai-context: - d2f97f3 [MrBot][doc] Add ADO PR cross-reference convention (Azure/azure-messaging-ai-context#7) c-build-tools: - 4fecdb3 [MrBot] Add review-pr skill for PR code review workflow (Azure/c-build-tools#326) - c752f1a Bump picomatch from 2.3.1 to 2.3.2 in /srs_extension (Azure/c-build-tools#366) - c424b9e Bump flatted from 3.2.5 to 3.4.2 in /srs_extension (Azure/c-build-tools#359) macro-utils-c: - 62b2d61 Increase nArithmetic from 2048 to 2560 (Azure/macro-utils-c#358)
…... (#630) Dependency updates: c-build-tools: - 97498a8 [MrBot] Add MAX_STAGE param; make ARM64 a blocking, test-running leg (Azure/c-build-tools#402)
…... (#632) Dependency updates: c-build-tools: - updated to latest c-logging: - updated to latest c-pal: - updated to latest c-testrunnerswitcher: - updated to latest c-util: - updated build/devops_gated.yml ctest: - updated to latest macro-utils-c: - updated to latest umock-c: - updated to latest
…efore user callbacks (#631) * fix channel ref release * Address PR comments: drop extra newline, add why-comment, add regression test - src/channel.c: remove the stray blank line introduced before the if (channel_op->on_data_available_cb != NULL) block. Add a why-comment explaining the rationale for releasing channel_op->channel before the user callbacks fire (avoid keeping a transitive THREADPOOL ref alive past the point where the caller wakes and drops its own references). - tests/channel_int: add test_pull_and_cancel_with_sleep_in_callback, a regression test that uses a new callback variant which sleeps for 100ms after wake_by_address_single. The sleep widens the cleanup-after- callback race window so that, without the fix, the worker is guaranteed to still be holding channel_op->channel at the time the test thread proceeds with channel_close and channel-ref release. With the fix in place this is harmless because the channel reference was already dropped before the user callback fired. Verified locally: * pre-fix code + new test: valgrind reports 12 'possibly lost' blocks totaling 33,730 B - same signature as build 161912975. * post-fix code + new test: valgrind passes, 0 leaks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR #631 review comments - src/channel.c: remove the why-comment per @parth21999 (the move itself is self-explanatory; the rationale lives in the PR description). - tests/channel_int: condense the sleep-callback comment to 2 short lines per @parth21999. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add short why-comment explaining early channel ref release * update comment --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dependency updates: c-build-tools: - 48198c5 [MrBot] Bump diff from 5.2.0 to 5.2.2 in /srs_extension (Azure/c-build-tools#409) c-pal: - 6355add Fix socket handle leak: always call closesocket/close after shutdown in disconnect (Azure/c-pal#561) - c95149d Fix InterlockedHL_WaitForXXX timeout accounting (Azure/c-pal#587) Co-authored-by: Navya Gaur <navyagaur@microsoft.com>
…... (#634) Dependency updates: c-build-tools: - 184c20b Configure Azure DevOps CLI defaults during setup (Azure/c-build-tools#407)
….. (#635) Dependency updates: c-build-tools: - c021f80 changed pool (Azure/c-build-tools#411)
…... (#636) Dependency updates: c-build-tools: - e5e02dd Clean up discover_native_tools output and report agent version/arch (Azure/c-build-tools#414) - 21b23fd [MrBot] Add C# MSTest AAA validation (Azure/c-build-tools#413) - 57b4388 Fix MSB3836 binding redirect warning for System.Collections.Immutable (Azure/c-build-tools#412)
…... (#637) Dependency updates: macro-utils-c: - dadf1dd Mirror infra-generated test layout in macro-utils-c (Azure/macro-utils-c#368)
…... (#638) Dependency updates: azure-messaging-ai-context: - 94278e4 [MrBot][AI] Tell address-pr-comments skill to stop leaving PR-narration comments in code (Azure/azure-messaging-ai-context#9) c-build-tools: - d1a97aa Support consumers with internal-ADO submodules and C# projects with private NuGet feeds (Azure/c-build-tools#405) c-testrunnerswitcher: - 658c3c6 [MrBot] Add guidance: prefer enum type in ASSERT_ARE_EQUAL (Azure/c-testrunnerswitcher#332) macro-utils-c: - c016a7f ZZZ (Azure/macro-utils-c#370) umock-c: - 037d2c1 have ALL max_stage fro ARM64 (Azure/umock-c#488)
Dependency updates: c-pal: - updated to latest
Update c-pal to include PR #583 (real_ps_util_renames in real_process_watchdog). This eliminates the need for UTs to link c_pal solely for watchdog support. Remove c_pal from ADDITIONAL_LIBS in UTs where it was added by the timed test conversion. Retain c_pal where it was pre-existing (needed for interlocked etc). Fix tarray_int: move timed_test_suite.h before ENABLE_MOCKS section to avoid unnecessary renames, remove real_process_watchdog and c_pal_ll_reals. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/AzurePipelines run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…to-timed-test-suite # Conflicts: # build/devops_gated.yml
d5d6c03 to
f6a3820
Compare
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Converts all test files from TEST_SUITE_INITIALIZE/CLEANUP to TIMED_TEST_SUITE_INITIALIZE/CLEANUP.
Changes:
Task 37635814: convert c-util to use TIMED_TEST_SUITE