Commit 60aa59a
Fix Port Binding Issue During Testing (#382)
This PR addresses the issue where tests would fail if the designated
port was already in use.
```
[INFO ] 2023-10-25 07:18:47,185 [main] com.oltpbenchmark.benchmarks.resourcestresser.TestResourceStresserBenchmark setUp - starting HSQLDB server for test [testGetTransactionType] on port [9099]
[Server@191774d6]: [Thread[HSQLDB Server @191774d6,5,main]]: run()/openServerSocket():
java.net.BindException: Address already in use
```
Changes:
- Modified the `setUp` method in `TestResourceStresserBenchmark` class.
- Added logic to try different ports using `ServerSocket` to find an
available port.
- ~~The system will attempt up to `MAX_TRIES` to find an open port
before throwing an exception.~~
- The the system will make a thorough effort in finding an available
port.
---------
Co-authored-by: Brian Kroth <bpkroth@users.noreply.github.com>1 parent e6e8d0a commit 60aa59a
1 file changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
| |||
0 commit comments