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

CI: Store Passes in results.json + various improvements. #57686

Merged
merged 6 commits into from
Mar 20, 2025

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Mar 8, 2025

  • Adds option to enable saving Test.Pass results to DefaultTestSet (started as Test: add option to record passes and enable it for CI #57690 but more complete here) and enable it when Base.runtests is called when CI=true, to match when reports are saved
  • Stops attributing testset duration to tests from that testset, it doesn't make sense.
  • Make the test name resemble (as far as possible) the original test call. Making the name independent of test outcome should make it easier to group tests and identify flaky ones.
  • store repeat counts as tags, rather than in the name
  • moves the save to inside the test workers, where all test info is available, and the save can be done in parallel to save time , then jsons are made at the end and uploaded as an artifact in a tarball
  • speed improvements to make saving time acceptable
  • fixes a couple of tests that seem to get a little flakier with this

Note on the WeakRef test fix: If a test like @test x == y passes, the Pass object retains x. Previously to this the Pass object was still made, but must have been GC-ed immediately. This PR remakes the Pass object when appending it to DefaultTestSet without the captured data. I think that just delayed the GC a little to make the test flaky, so I moved the @test to outside the function to avoid capturing x.

Also buildkite had to fix an issue to make tests show up properly on our jobs:
https://forum.buildkite.community/t/test-failures-showing-up-in-test-digest-but-not-on-jobs/4306

@IanButterworth IanButterworth added testsystem The unit testing framework and Test stdlib ci Continuous integration labels Mar 8, 2025
@IanButterworth IanButterworth force-pushed the ib/test_json_fixes branch 2 times, most recently from 95328b4 to 96ec737 Compare March 9, 2025 03:33
@IanButterworth IanButterworth marked this pull request as draft March 9, 2025 03:43
@IanButterworth IanButterworth force-pushed the ib/test_json_fixes branch 2 times, most recently from e5cabc0 to 149657f Compare March 9, 2025 14:31
@vchuravy
Copy link
Member

Stop attributing testset duration to tests from that testset, it doesn't make sense.

Can you expand on this a little bit?

@IanButterworth
Copy link
Member Author

Currently we report that a test takes the duration of its parent testset. So @test x == 1 could be reported to take like 10 minutes. I think it's misleading.

@vchuravy
Copy link
Member

Oh yeah, that's silly. Can we capture useful duration times?

@IanButterworth
Copy link
Member Author

IanButterworth commented Mar 10, 2025

Our Result types don't currently store timing information. We could add it, but tbh I'm not sure it's any more useful. The useful information is somewhere inbetween the testset and the @test duration. If testsets were strictly a single test setup + test then it'd probably be fair to report testset duration. But testsets are very commonly a group of many sequential setups and tests.

@IanButterworth IanButterworth force-pushed the ib/test_json_fixes branch 4 times, most recently from bcc4cf0 to 03861bb Compare March 15, 2025 15:28
@IanButterworth
Copy link
Member Author

It seems like dropping the value from the Pass does help memory usage but the weakref test is failing again. I guess that test just was dependent on the Pass object with the value captured being freed immediately and this somehow slightly delays it.

Also, it seems like bk considers tests with 0.0 duration to not have run.. these last few runs report no tests, so I think I'll just set all tests to 1.0 duration.

@IanButterworth IanButterworth force-pushed the ib/test_json_fixes branch 2 times, most recently from f7ec9f6 to 9bc0a07 Compare March 15, 2025 22:33
@IanButterworth
Copy link
Member Author

IanButterworth commented Mar 16, 2025

Hitting a buildkite issue: https://forum.buildkite.community/t/test-failures-showing-up-in-test-digest-but-not-on-jobs/4306

(buildkite are looking into it)

@IanButterworth IanButterworth force-pushed the ib/test_json_fixes branch 3 times, most recently from 86829c5 to 1290873 Compare March 19, 2025 03:18
@IanButterworth IanButterworth changed the title CI: Tweaks to results.json CI: Store Passes in results.json + various improvements. Mar 19, 2025
@IanButterworth IanButterworth marked this pull request as ready for review March 19, 2025 15:53
@IanButterworth IanButterworth requested a review from vchuravy March 19, 2025 15:53
@IanButterworth IanButterworth merged commit d971131 into JuliaLang:master Mar 20, 2025
8 checks passed
@IanButterworth IanButterworth deleted the ib/test_json_fixes branch March 20, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants