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

Rework MRI test exclusions #3658

Merged
merged 27 commits into from
Sep 27, 2024

Commits on Sep 24, 2024

  1. Configuration menu
    Copy the full SHA
    4861136 View commit details
    Browse the repository at this point in the history
  2. Move the ',' delimiter into the prefix because otherwise partial name…

    …s can cause false positives.
    
    We might process two tests named `test_rstrip` and `test_rstrip_bang`. Without the delimiter as part of the prefix, `test_rstrip` would look like a prefix for `test_rstrip_bang`, causing the tool to skip `test_rstrip_bang` thinking it was already added. Depending on the order the tests were processed in you could get two different sets of tags with the same test failures. This was causing us to lose some tags and get different results when retagging MRI tests with random seeds.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7f4a6c9 View commit details
    Browse the repository at this point in the history
  3. Sort the MRI tag files so we get deterministic output.

    The old logic emitted the tags in the order the tests were executed. As a result, if tests are run with random seeds you can get two different files.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    626100e View commit details
    Browse the repository at this point in the history
  4. Allow jt retag to skip over MRI tests that were previously known to…

    … hang.
    
    While this mode means we may continue to exclude a test for an issue that may be fixed, the common problem is the test continues to hang. With the tag file completely cleared we attempt to run that test again and it halts the entire process, require manual intervention to:
    
    * Kill the stuck process
    * Manually re-add the tag
    * Re-run the tests and pipe into the error processing script without the hepl of `jt tag` in order to run the tests with the partially filled tag file
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    bffd383 View commit details
    Browse the repository at this point in the history
  5. Fix search of MRI test exclusion files.

    In some cases we have directories that match the search prefix and they will naturally not include the tagged test data.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    56f38f1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    396cbc2 View commit details
    Browse the repository at this point in the history
  7. More jt retag retentions.

    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7106f57 View commit details
    Browse the repository at this point in the history
  8. Handle invalid byte sequences in the MRI test errors.

    Some tests deliberately insert broken bytes or the test sets the encoding to something other than UTF-8. In those cases we may have strings with byte sequences in them that are invalid in UTF-8. Since these are limited to error messages, we can safely ignore them. What we really need to be able to do is split each line in the results file apart and extract key pieces of information. The method names, which are most import for setting up any test exclusions, must be made up of valid bytes.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    f39954d View commit details
    Browse the repository at this point in the history
  9. Handle extracting class names from MRI test files that aren't UTF-8.

    Scrubbing isn't an entirely fool-proof method, but all of the class names thus far have been ASCII-only, and that's really the data we're after. Non-UTF-8 byte sequences elsewhere in the test will be mangled but we're not doing anything with them here. When we run the tests they'll execute with the correct encoding.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7bef864 View commit details
    Browse the repository at this point in the history
  10. Improve MRI test exclusion messages when the correct exception type i…

    …s raised but with the wrong message.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    7e619c1 View commit details
    Browse the repository at this point in the history
  11. Add automatic tagging of slow tests to MRI test tagging.

    We tend not to retag the MRI tests very frequently. Having the test Ruby version information there gives an idea of when the test was last run and what build type was use (e.g., native vs JVM). It's easy to ping-pong on retagging slow tests because they're necessarily dependent on the version of TruffleRuby and the system the tests were run on. Providing that context should help us keep track of what should be reevaluated and when a slow tag should be retained."
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    630b9f3 View commit details
    Browse the repository at this point in the history
  12. Make MRI test retagging more resilient to escaped exceptions.

    We currently run the MRI tests with assertions enabled. Those assertions all escape the interpreter and result in the process failing. That can result in the existing tag file getting deleted without being repopulated.
    
    What we do here is capture stderr along with the test log and parse it to see if we have any escaped exceptions. If so, tag the corresponding test and then tell the retagger to rerun the test. The new tag will be retained so that test will not run again, allowing the testing process to make forward progress. This makes retagging more reliable and less frustrating.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    5e83488 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a36adb7 View commit details
    Browse the repository at this point in the history
  14. Add a retry loop when tagging MRI test files that fail due to undefin…

    …ed symbols.
    
    When we encounter the usage of an undefined symbol the process exits, which means we don't end up running all of the tests. Much like we do with assertion errors, this will now tag the associated test and then restart the tagging operation, retaining the newly created tags so the associated tests will be skipped.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c9ac0cc View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    bbfa38f View commit details
    Browse the repository at this point in the history
  16. Retain MRI test exclusion tags for tests that have historically been …

    …killed while running.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    53e0cd7 View commit details
    Browse the repository at this point in the history
  17. Handle tag generation for MRI tests that time out.

    When a test times out it often will not print a trace. The previous logic would try to extract one anyway and that could result is misattribution since the data format doesn't match what the search logic is looking for. Rather than search for something that isn't there, we now can tag the test with a message indicating the test timed out and move on with processing the next failure or error.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c40909b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    e9df4ce View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e1a60ef View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    039be93 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    f26bec6 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    01fe314 View commit details
    Browse the repository at this point in the history
  23. Added more documentation for each of the regexps used in parsing the …

    …MRI test log file.
    
    Also reorganized the code a bit since the comments are long and it was breaking up the flow of the code.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    511dc7e View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    8374832 View commit details
    Browse the repository at this point in the history
  25. Regenerate the list of MRI test exclusions.

    With enhancements to the retagging process we now have the ability to generate much more helpful reasons for each tag. This change replaces most "needs investigation" generic comments with something that makes it much easier to see why an MRI test failed. Additionally, we had many stale tags, which have now been deleted as part of the bulk retagging process.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    69c296a View commit details
    Browse the repository at this point in the history
  26. Remove some patterns for retaining MRI test exclusions upon retag.

    Now that we have robust retry logic on errors that bubble out and stop the test runner process, we don't need to retain those tags; they can be safely recomputed. Other patterns are just obsolete and should have been removed when the last reference to them was removed in the tag files.
    nirvdrum committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    48e835c View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    6d05853 View commit details
    Browse the repository at this point in the history