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

tests/thread: Restore gc before test case ends. #15265

Merged

Conversation

projectgus
Copy link
Contributor

Summary

Otherwise GC stays disabled (not re-enabled by soft reset) and later test runs fail with MemoryError.

Note this test case is currently disabled in CI due to "reliability issues" (as of 02b44a0). Not sure if this is the root cause of the issue in question.

Testing

  • Tested on rp2 port and verified subsequent test failures went away.
  • Also re-ran tests on unix port with run-tests.py -d thread, but no change expected here as a new micropython process is run for each test file.

Trade-offs and Alternatives

We could have soft reset re-enable automatic gc, instead? Would be more resilient than this fix, but might have other implications.

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.42%. Comparing base (4074643) to head (739704b).

Current head 739704b differs from pull request most recent head 5a778eb

Please upload reports for the commit 5a778eb to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15265   +/-   ##
=======================================
  Coverage   98.42%   98.42%           
=======================================
  Files         161      161           
  Lines       21204    21204           
=======================================
  Hits        20870    20870           
  Misses        334      334           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpgeorge
Copy link
Member

Thanks, this fix is good.

The CI reliability of these stress tests is more likely related to globals not being protected by a mutex, see related #11604.

Otherwise GC stays disabled (not re-enabled by soft reset) and later test
runs fail with MemoryError.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@dpgeorge dpgeorge force-pushed the bugfix/test_threads_stress_schedule_gc branch from 739704b to 5a778eb Compare June 21, 2024 04:47
@dpgeorge dpgeorge merged commit 5a778eb into micropython:master Jun 21, 2024
22 of 23 checks passed
@projectgus projectgus deleted the bugfix/test_threads_stress_schedule_gc branch June 25, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants