Commit 4aecd8e
Fix detect tarantool crash at exit
> What's the problem?
During the shutdown of the server, the server process is polled. If the
call `ffi.C.kill(<pid>, 0)` returns the value 0, then the process will
be considered alive, otherwise it will be dead.
Luatest cannot distinguish the states when the process is completed
correctly and incorrectly. This means that if a critical error appears
at the end of the process (e.g., segmentation fault), then stopping the
server will be considered successful (and the test-case too).
> What's the solution?
Each process contains its own instance of output_beautifier (which reads
stdout and stderr). Now this instance will contain the stderr field (str)
where the entire stderr from the process will be saved.
During the server shutdown, it looks for the substring 'segmentation fault'
and return an error if the substring is found:
Segmentation fault during process termination (alias: master,
workdir: master-SrQjEIiLyRHS, pid: 152323)
Segmentation fault
code: SEGV_MAPERR
addr: (nil)
...
Closes #2521 parent 89da427 commit 4aecd8e
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
370 | 381 | | |
371 | 382 | | |
372 | 383 | | |
| |||
0 commit comments