Commit 434cbec
committed
Fix decoding error when reading server's log file
When a diff test starts a Tarantool server, test-run reads the server's
log file and tries to find the message indicating the server is ready.
Sometimes the server's log file may contain bytes that cannot be decoded
by `utf-8` codec and test-run fails with an error like this:
[044] TarantoolInpector.handle() received the following error:
[044] Traceback (most recent call last):
[044] File "/tarantool/test-run/lib/inspector.py", line 98, in handle
[044] result = self.parser.parse_preprocessor(line)
[044] File "/tarantool/test-run/lib/preprocessor.py", line 123, in parse_preprocessor
[044] return self.server(stype, sname, options)
[044] File "/tarantool/test-run/lib/preprocessor.py", line 351, in server
[044] return getattr(self, attr)(ctype, sname, opts)
[044] File "/tarantool/test-run/lib/preprocessor.py", line 209, in server_start
[044] self.servers[sname].start(silent=True, rais=True, wait=wait,
[044] File "/tarantool/test-run/lib/tarantool_server.py", line 910, in start
[044] self.wait_until_started(wait_load, deadline)
[044] File "/tarantool/test-run/lib/tarantool_server.py", line 1147, in wait_until_started
[044] self.wait_load(deadline)
[044] File "/tarantool/test-run/lib/tarantool_server.py", line 1131, in wait_load
[044] if not self.logfile_pos.seek_wait(msg, p, self.name, deadline):
[044] File "/tarantool/test-run/lib/tarantool_server.py", line 485, in seek_wait
[044] log_str = f.readline()
[044] File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/codecs.py", line 322, in decode
[044] (result, consumed) = self._buffer_decode(data, self.errors, final)
[044] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 660: invalid continuation byte
At least, I have seen such errors when Tarantool with JIT enabled was
tested on macOS ARM64 machines. So this patch fixes the issue.1 parent 52ca8cf commit 434cbec
1 file changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
443 | 454 | | |
444 | 455 | | |
445 | | - | |
| 456 | + | |
446 | 457 | | |
447 | 458 | | |
448 | 459 | | |
449 | 460 | | |
450 | 461 | | |
451 | 462 | | |
452 | 463 | | |
453 | | - | |
| 464 | + | |
454 | 465 | | |
455 | 466 | | |
456 | 467 | | |
| |||
472 | 483 | | |
473 | 484 | | |
474 | 485 | | |
475 | | - | |
| 486 | + | |
476 | 487 | | |
477 | 488 | | |
478 | 489 | | |
| |||
979 | 990 | | |
980 | 991 | | |
981 | 992 | | |
982 | | - | |
| 993 | + | |
983 | 994 | | |
984 | 995 | | |
985 | 996 | | |
| |||
0 commit comments