Skip to content

Commit

Permalink
Fix: Timeout for unatted tests. (#643)
Browse files Browse the repository at this point in the history
Fixes: ooni/probe#2644


## Proposed Changes

  - Check if the test is `unattended` before setting a timeout.
  - Reference issue: ooni/probe#2644
  • Loading branch information
aanorbel authored Dec 12, 2023
1 parent 3b27a17 commit 2e87252
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,18 @@ private void downloadURLs() {

currentTest.setInputs(inputs);

if (currentTest.getMax_runtime() == null)
/*
* Set the maximum runtime if the test doesn't yet have it. This is only done if the test is not unattended.
* Previously, this was not required, because the code path for unattended tests
* did not call this method. However, now that we are using the same code path as of https://github.com/ooni/probe-android/pull/572,
* This is now required to ensure the manual tests follow the preference set by the user,
* while the unattended tests doesn't.
*
* See https://github.com/ooni/probe/issues/2644.
*/
if (currentTest.getMax_runtime() == null && !unattended) {
currentTest.setMax_runtime(app.getPreferenceManager().getMaxRuntime());
}
publishProgress(URL);
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 2e87252

Please sign in to comment.