-
Notifications
You must be signed in to change notification settings - Fork 27
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
Handle key errors gracefully in a static queue #272
Conversation
But why do we do that? Also if there is a legitimate reason to provide non-existing IDs, then it's not the queue responsability to ignore these, but the runner. |
I agree with Jean, I don't think we can or should just ignore key errors. |
IMO if a test id doesn't exist the bisect is invalid and can't be trusted. |
@casperisfine So there is usually some delay between when we consume a failing test and when we trigger a leakbot bisect on the test order that failed the test. This delay is between 1-3 days because we have a lot of failing test orders to analyze and we cap to 50 leakbot bisects per hour. In those 1-3 days of delay, somes test ids could have changed due to change in test file path / renamed test / deleted test. |
Why would it be invalid? Bisect could still isolate a leak if the non-existing test id does not raise a missing test id error. |
@casperisfine to further advocate, we've been seeing a lot of false positives of bisects lately and large portion of them are due to the fact that that we run the bisects on a branch that is older than a commit where a fix is made. Always running bisects on We could add some alternate logic on the client side that compares git commits between a bisect was caught vs when a potential fix could've been made to |
I don't think it needs to be that complicated, you can just alter the test order file. # load_all_tests
if ENV["REMOVE_NOT_EXISTING_TESTS"]
loaded_tests = Minitest::Test.runnables.flat_map do |runnable|
runnable.runnable_methods.map do |method_name|
"#{runnable}##{method_name}"
end
end
tests_to_bisect = File.read("test_order.log").lines.map(&:squish)
test_order = tests_to_bisect & loaded_tests
puts "Removing #{tests_to_bisect.size - test_order.size} tests that no longer exist"
File.write("test_artifacts/test_order.log", test_order)
end |
It sounds to me that the solution should be for the leakbot build to use the same app revision than the failure report. |
Yeah we do that for most part but sometimes want to check on main if the same issue still exists. |
The static queue executes tests during bisect and it leads to an incorrect outcome plus unexpected errors when we specify a non-existing test ID in the test order provided to the bisect command. We want to start bisecting test orders in
main
to reduce false positive outcomes. So several test IDs in a given flaky test order that was captured in an older commit could now be missing due to change in test file path / renamed test / deleted test. If we don't handle missing keys gracefully, bisect incorrect thinks that the static queue came across a test failure, which leads to incorrect outcomes.