Commit 84fbaaa
committed
In Cucumber, if there is an exception in the beforeScenario handler, the afterScenario is not called. Catch the exception in the beforeScenario and free the device in such a case.
Longer version: For each new test that starts running, ATD marks a device "busy" before creating a new driver instance from the beforeScenario. When running a suite of tests, if there is a problem in the driver initialisation resulting in an exception for each test, eventually all devices end up getting marked as "BUSY" in beforeScenario. Once all the devices are "busy", for subsequent tests, there are no available devices, and the thread ends up in suspended state till some device becomes "free". The solution is to catch the exception when creating the driver, and in this case, free the device before re-throwing the exception.1 parent c1a26f5 commit 84fbaaa
1 file changed
Lines changed: 4 additions & 0 deletions
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
0 commit comments