On Thu, Apr 4, 2013 at 8:46 AM, Kornel Benko <kor...@lyx.org> wrote: > Am Donnerstag, 4. April 2013 um 08:04:20, schrieb Scott Kostyshak > <skost...@lyx.org> > >> I guess this means that the time it takes to remove the previous core > >> is just enough to make it sometimes fail. > >> > >> > With the Sleep it failes all the time (tried 10 times) > >> > >> OK. I haven't looked at the code but I'm guessing there's already a > >> delay in-between the last command and when the PID is tested. We could > >> increase that. If it's not there, we could add it. > >> > >> I wonder if a better way of doing this is to put the burden of exiting > >> LyX on the test. For example, each test could simply execute > >> 'lyx-quit' at the end. We would have to deal with the "Save changed > >> document?" dialog by executing a tab (to get to "Discard") and return. > >> > >> We could then use the 'wait' command. It seems that this would > >> simplify things a lot. The 'wait' command has two advantages: > >> (1) We don't have to manually check the PID (which we saw gives problems) > >> and > >> (2) We can get the return code. > >> > >> I don't know if that's better or worse. But that's the only > >> alternative I can think of. > >> > > > > This one works too (for this test) > > TestEnd test ! -e ../bug-8370.lyx.emergency > > > > because we are always removing ../bug-8370.lyx.emergency prior to test.
That looks good and safe. I wonder if that also works for the tests under autotools. I think so because the .lyx file should be in the same (relative) place. As a note to myself when I re-read this thread: Another strategy is to try to do something in LyX after the crash does or does not happen. For example, insert a character and test that the character was inserted (by grepping the log). Scott