You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add time_limit_secs option, return partial results when out of time
Summary:
This diff adds a `time_limit_secs` option to `hh --find-my-tests-staging`. When reaching the time limit, we return whatever tests we selected up to that point. The JSON output of the command is changed so that instead of just returning a list, we return an object now with a boolean field `out_of_time`, indicating whether we hit the time limit.
Note that I'm avoiding the term `timeout` since `hh_client` already has its own, orthogonal timeout mechanism where the client cancels if not getting a response from the server before the timeout. But what I'm doing here is different, since my time limits are enforced by the server, not the client.
Implementation notes: On the server side, we check the current time against a deadline value in every iteration of our test BFS graph construction. There is only one exception: `FindRefsService.find_references` can take arbitrarily long, because it may need to type-check thousands of files. Therefore, I added an optional `deadline` parameter to it. There was already a cancelation mechanism within `FindRefsService`, the new `deadline` is re-using that.
Reviewed By: madgen
Differential Revision: D94660244
fbshipit-source-id: 8d46036bc8c434f6e53e901576062d49b1295af2
0 commit comments