@@ -210,9 +210,9 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
210
210
211
211
// Reuse waitForUploadPort for this task, but this time we are simply waiting
212
212
// for one port to reappear. If no port reappears before the timeout, actualUploadPort is selected
213
- finalUploadPort = waitForUploadPort (actualUploadPort , Serial .list (), false );
213
+ finalUploadPort = waitForUploadPort (actualUploadPort , Serial .list (), false , 2000 );
214
214
}
215
- } catch (InterruptedException ex ) {
215
+ } catch (RunnerException ex ) {
216
216
// noop
217
217
}
218
218
}
@@ -229,13 +229,13 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
229
229
}
230
230
231
231
private String waitForUploadPort (String uploadPort , List <String > before ) throws InterruptedException , RunnerException {
232
- return waitForUploadPort (uploadPort , before , verbose );
232
+ return waitForUploadPort (uploadPort , before , verbose , 10000 );
233
233
}
234
234
235
- private String waitForUploadPort (String uploadPort , List <String > before , boolean verbose ) throws InterruptedException , RunnerException {
235
+ private String waitForUploadPort (String uploadPort , List <String > before , boolean verbose , int timeout ) throws InterruptedException , RunnerException {
236
236
// Wait for a port to appear on the list
237
237
int elapsed = 0 ;
238
- while (elapsed < 10000 ) {
238
+ while (elapsed < timeout ) {
239
239
List <String > now = Serial .list ();
240
240
List <String > diff = new ArrayList <>(now );
241
241
diff .removeAll (before );
0 commit comments