"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

Mark Jamsek <mark@jamsek.com>
Re: tog: basic diff regress
Game of Trees <gameoftrees@openbsd.org>
Sat, 15 Apr 2023 21:07:35 +1000

Download raw body.

On 23-04-15 11:12AM, Stefan Sperling wrote:
> On Sat, Apr 15, 2023 at 06:59:49PM +1000, Mark Jamsek wrote:
> > This is a rebased diff on top of main with the basic diff and blame
> > regress, and your TOG_TEST_SCRIPT suggestion.
> Great! ok.
> > +	if (strncasecmp(line, "SLEEP ", 6) == 0 &&
> > +	    isdigit((unsigned char)line[6])) {
> > +		sleep(line[6] - '0');
> > +		*ch = -1;
> Instead of sleeping, or skipping interactive display based on using_mock_io,
> we could have scripting instructions that wait until a certain event occurs.
> Such as "wait until the blame thread signals that it is done".
> That would also fix the problem and be generally applicable to similar
> cases such as when the log thread is involved. But perhaps checking
> using_mock_io is simpler? I am not sure.
> Interactive use depends on the main thread sleeping in getch(), so in
> that case the main thread should never block for long. But tests probably
> won't need that behaviour?

Hmm...Yes, both are good options. Let me think about this a bit and come
up with something. I think I'm leaning to the new instruction to
optionally wait on an event. Although either approach is an improvement,
I think that way offers a more suitable solution. Thanks!

Mark Jamsek <fnc.bsdbox.org|got.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68