Skip to content
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

Ressurect tests for GC+coroutines #8204

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yorickvP
Copy link
Contributor

Motivation & Context

Redo #7725. GC mostly happens on a best-effort basis, and is sensitive to compilation. This was failing on musl and x86.

Change the relevant assertions to EXPECT_, causing them to just print a warning instead of failing the test.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

@yorickvP yorickvP requested a review from edolstra as a code owner April 11, 2023 15:38
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Apr 11, 2023
@yorickvP
Copy link
Contributor Author

cc @thufschmitt


// Generate 2 objects, discard one, run gc,
// see if one got collected and the other didn't
// GC is disabled inside coroutines on __APPLE__
Copy link
Member

Choose a reason for hiding this comment

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

I think this kind of test is inherently unreliable, particularly the part where it checks that an object got collected. Since Boehm is a conservative collector, you can never be certain that no pointer to an object survives. For instance, you can't really count on an assignment like do_collect = nullptr; not being optimized away.

Copy link
Member

Choose a reason for hiding this comment

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

You could increase the odds by allocating a large number of individual objects.
If none of them gets collected, we probably have a significant GC issue anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants