Commit 6a76770
authored
fix: avoid None.strip() error in TCP mode by checking server_socket (#633)
### What problem were solved in this pull request?
Problem:
When `server_socket` parameter is `None` (which is valid when using TCP
port mode only), the code calls `server_socket.strip()` which raises an
`AttributeError` because `None` has no `strip()` method. This prevents
the test framework from initializing properly when Unix socket is not
configured.
### What is changed and how it works?
Modified all occurrences of `server_socket.strip()` to
`server_socket.strip() if server_socket else ''` in the following test
files:
1. `test/integration_test/miniob/miniob_client.py` - Line 36
2. `test/integration_test/miniob/miniob_server.py` - Line 57
3. `test/integration_test/miniob_test_util.py` - Lines 129 and 391
4. `test/case/miniob_test.py` - Lines 113 and 277
This change ensures that when `server_socket` is `None`, it is safely
converted to an empty string, allowing the code to fall back to TCP port
mode. The existing logic already handles empty strings correctly by
checking `if len(self.__server_socket) > 0` before attempting to use
Unix socket.
### Other information
This is a minimal fix that improves the robustness of the test framework
by handling the case where Unix socket is not configured.1 parent 707a0e0 commit 6a76770
File tree
4 files changed
+6
-6
lines changed- test
- case
- integration_test
- miniob
4 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
0 commit comments