-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual void Catch::CumulativeReporterBase::testCaseEnded(const Catch::TestCaseStats&): Assertion `m_sectionStack.size() == 0' failed #1210
Comments
This is happening almost all the time now |
Do you have a reliable repro, or is it still an intermittent thing? The JUnit reporter is ran multiple times on each commit and it doesn't reproduce with our tests, so it's hard to tell what is going on. |
I will work on a repro |
I'm using #define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
TEST_CASE("doomed", "[tag]") {
SECTION("only section") {
REQUIRE(false);
}
}
|
@sd-x That's actually quite useful, thanks. |
Seeing this also in my CI sometimes. |
I'm seeing this pretty regularly, but not 100% consistently, on our windows builds. We don't have exceptions disabled or anything. Is the recommended workaround to stop using SECTIONs? for reference, also using junit. seems to be a common factor in these reports. |
Our GitLab CI just ran into the same or a very similar issue, the exact assertion error in our case is
We are also running on Windows and using the JUnit reporter. Catch version v2.11.1, MSVC 16.5. The issue disappeared after rerunning. |
Probably I found one possible scenario, why it could happen #1967 |
My problem was that I was dividing by zero which crashed on my Linux CI but did not crash on my macOS dev machine. A working stacktrace from Catch would have saved me 30 minutes of printf debugging! |
I am not too familiar with catch internals but here is what I assume is happening In
If I understand it correctly, running Sections are in My (potentially very dirty) fix is the following before the call to while (!m_activeSections.empty()) {
auto nl = m_activeSections.back()->nameAndLocation();
SectionEndInfo endInfo{ SectionInfo(nl.location, nl.name), {}, 0.0 };
sectionEndedEarly(CATCH_MOVE(endInfo));
}
handleUnfinishedSections(); I move the Sections from Btw, here is a test case that reproduces the issue for me (with TEST_CASE("broken") {
SECTION("section") {
/// Use illegal cpu instruction
__asm__ __volatile__("ud2" : : : "memory");
}
} |
Closes catchorg#1210 When a signal is caught, the destructors of Sections will not be called. Thus, we must call `sectionEndedEarly` manually for those Sections. Example test case: ``` TEST_CASE("broken") { SECTION("section") { /// Use illegal cpu instruction __asm__ __volatile__("ud2" : : : "memory"); } } ```
Closes catchorg#1210 When a signal is caught, the destructors of Sections will not be called. Thus, we must call `sectionEndedEarly` manually for those Sections. Example test case: ``` TEST_CASE("broken") { SECTION("section") { /// Use illegal cpu instruction __asm__ __volatile__("ud2" : : : "memory"); } } ```
Closes #1210 When a signal is caught, the destructors of Sections will not be called. Thus, we must call `sectionEndedEarly` manually for those Sections. Example test case: ``` TEST_CASE("broken") { SECTION("section") { /// Use illegal cpu instruction __asm__ __volatile__("ud2" : : : "memory"); } } ```
Description
I am getting this error sometimes in CI.
Rerunning the job fixes the problem.
This was mentioned in a comment to #663.
Extra information
The text was updated successfully, but these errors were encountered: