Skip to content

Tweak the dropped runtime events test#12397

Merged
dra27 merged 2 commits intoocaml:trunkfrom
dra27:tweak-test
Sep 26, 2024
Merged

Tweak the dropped runtime events test#12397
dra27 merged 2 commits intoocaml:trunkfrom
dra27:tweak-test

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Jul 20, 2023

While debugging something else, @NickBarnes and I spotted that this test was setting OCAMLRUNPARAM in a slightly unusual way. We then further looked at this test and wondered how it can ever fail (I'm guessing its original intent was more to ensure that the runtime didn't segfault!) so I've added a check to ensure events were actually dropped (and also checked that with suitably large e they are indeed not dropped).

cc @sadiqj

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Jul 20, 2023

I’ve apparently not checked 32-bit, though 🤦‍♂️

@gasche
Copy link
Copy Markdown
Member

gasche commented Sep 17, 2024

One option is to remove this test entirely. We already had to tweak it with @NickBarnes, so it's consumed some amount of maintenance time already, and hasn't caught any regression that I know of. We could forget about it. My worry is that its unreliability might be hiding other issues (maybe on 32bit settings?) that we should know about, and we would forget about conveniently if we just drop the test.

@sadiqj
Copy link
Copy Markdown
Contributor

sadiqj commented Sep 22, 2024

So this test originally came from @TheLortex in #12062 - it was added because at the time the consumer would note that an event was dropped but still go ahead and try to parse it anyway, which resulted in a segfault sometimes (and incorrect data).

I think the new robustness is a good idea.

My worry about dropping this test is the same as @gasche though, is it hiding issues on lesser-used platforms where we've just not had any reports? I think given the way the test is written on trunk, a failure is generally a bad sign.

@gasche
Copy link
Copy Markdown
Member

gasche commented Sep 25, 2024

This test appears to be broken in trunk (I see it fail semi-regularly on clang-cl at least). In #13476 I propose to disable it on Windows for now.

@dra27 dra27 force-pushed the tweak-test branch 2 times, most recently from 1119367 to 4b5f3db Compare September 26, 2024 14:16
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Sep 26, 2024

Temporarily pushed with msvc restored, but this should not be merged with #13476 reverted.

@dra27 dra27 requested a review from sadiqj September 26, 2024 14:18
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Sep 26, 2024

I tested this locally (on Linux and Windows) with the fix in #12062 reverted, and it's very quickly and consistently catching it (as a corrupt ring, rather than a segfault).

Copy link
Copy Markdown
Contributor

@sadiqj sadiqj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a lot more robust, thanks @dra27

@dra27 dra27 merged commit 78ed258 into ocaml:trunk Sep 26, 2024
@dra27 dra27 deleted the tweak-test branch September 26, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants