git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH v2 4/6] Force test suite traps to be cleared for NonStop ksh

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Jan 21, 2018, 04:07 UTC
Message-ID
<001001d3926d$6c4f6730$44ee3590$@nexbridge.com>
In-Reply-To
<000c01d39174$eacfff10$c06ffd30$@nexbridge.com>
On January 19, 2018 5:29 PM, I wrote:
Show 65 quoted lines
> On January 19, 2018 4:27 PM, Jeff King wrote:
> > On Fri, Jan 19, 2018 at 12:34:04PM -0500, randall.s.becker@rogers.com
> wrote:
> >
> > > From: "Randall S. Becker" <rsbecker@nexbridge.com>
> > >
> > > * t/lib-git-daemon.sh: fix incompatibilities with ksh traps not being
> > >   cleared automatically on platform. This caused tests to seem to fail
> > >   while actually succeeding.
> > >
> > > Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
> > > ---
> > >  t/lib-git-daemon.sh | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/t/lib-git-daemon.sh b/t/lib-git-daemon.sh index
> > > 987d40680..955beecd9 100644
> > > --- a/t/lib-git-daemon.sh
> > > +++ b/t/lib-git-daemon.sh
> > > @@ -68,6 +68,7 @@ start_git_daemon() {
> > >  		test_skip_or_die $GIT_TEST_GIT_DAEMON \
> > >  			"git daemon failed to start"
> > >  	fi
> > > +	trap '' EXIT
> > >  }
> >
> > I don't think this can be right. The way these traps are supposed to work is:
> >
> >   - as soon as test-lib.sh is loaded, we "trap die EXIT" to catch an
> >     accidental death/exit from one of the scripts
> >
> >   - when test_done is called, we clear the trap (i.e., it is OK to exit
> >     now because the script has given us a positive indication that all
> >     tests have been run)
> >
> >   - while the child git-daemon is running, we'd want to clean up after
> >     ourselves. So during start_git_daemon() we add our cleanup (followed
> >     by the original "die", because shell traps don't push onto a stack).
> >     And then at stop_git_daemon(), we restore the original die trap.
> >
> > But this patch means that while git-daemon is running, we have no trap at
> all!
> > That means that a failed test which causes us to exit would leave a
> > child daemon running.
> >
> > Furthermore, both of these functions now drop the 'die' trap entirely,
> > meaning the script would fail to notice premature exit from one of the
> > test snippets.
> >
> > So while this may be papering over a problem on NonStop, I think it's
> > breaking the intent of the traps.
> >
> > I'm not sure what the root of the problem is, but it sounds like ksh
> > may be triggering EXIT traps when we don't expect (during function
> returns?
> > Subshell exits? Other?)
> 
> The "unexpected" EXIT traps are exactly the issue we found when working
> with the platform support team. There was some discussion about what the
> right expectation was, and I was not able to have a change made to ksh on
> the platform. The problem may have a similar (identical?) root cause to the
> Perl exit issues we are also experiencing that is in their hands. I'm currently
> retesting without this change (results in 36 hours ☹ ). Is there a preferred
> way you would like me to bypass this except on NonStop? I can add a check
> based on uname.
After running through the git test suite, it turns out that this particular need has gone away as of the latest OS releases. The test results without the trap '' EXIT are identical to that with the trap (6 breaks that look completion code handling-related on the platform). I'm going to drop the need for this and repackage the entire set of patches applying everyone's comments and removing this (4/6) and the GCC attribute (1/6) patch. This will be followed-up with generalizing the setbuf and tar patches for a broader audience, but I need a bit more time for that generalization.
Please accept my thanks and expect the updated set tomorrow, which will be sufficient to bring the NonStop NSE, NSX, and NSV platforms into the common code-base for git at long last.

Cheers, Randall

Previous: Randall S. BeckerNext: randall.s.becker@rogers.com
Message 14 of 32 in “Force pipes to flush immediately on NonStop platform”
  1. 0/6 Force pipes to flush immediately on NonStop platformrandall.s.becker@rogers.com, Jan 19, 2018
  2. 1/6 Bypass GCC attributes on NonStop platform where used.randall.s.becker@rogers.com, Jan 19, 2018
  3. Stefan BellerJan 19, 2018
  4. Ramsay JonesJan 19, 2018
  5. Jeff KingJan 19, 2018
  6. Ramsay JonesJan 19, 2018
  7. Randall S. BeckerJan 19, 2018
  8. 0/6 Cover Letter for NonStop Port Patchesrandall.s.becker@rogers.com, Jan 19, 2018
  9. 4/6 Force test suite traps to be cleared for NonStop kshrandall.s.becker@rogers.com, Jan 19, 2018
  10. Stefan BellerJan 19, 2018
  11. Jeff KingJan 19, 2018
  12. Randall S. BeckerJan 19, 2018
  13. Randall S. BeckerJan 19, 2018
  14. Randall S. BeckerJan 21, 2018
  15. 6/6 Add intptr_t and uintptr_t to regcomp.c for NonStop platform.randall.s.becker@rogers.com, Jan 19, 2018
  16. 5/6 Bring NonStop platform definitions up to date in git-compat-util.hrandall.s.becker@rogers.com, Jan 19, 2018
  17. 2/6 Add tar extract install options override in installation processing.randall.s.becker@rogers.com, Jan 19, 2018
  18. René ScharfeJan 20, 2018
  19. Randall S. BeckerJan 20, 2018
  20. René ScharfeJan 20, 2018
  21. Randall S. BeckerJan 20, 2018
  22. Ævar Arnfjörð BjarmasonJan 20, 2018
  23. Randall S. BeckerJan 20, 2018
  24. 3/6 Define config options required for the HPE NonStop NSX and NSE platformsrandall.s.becker@rogers.com, Jan 19, 2018
  25. Stefan BellerJan 19, 2018
  26. Torsten BögershausenJan 20, 2018
  27. Randall S. BeckerJan 20, 2018
  28. Junio C HamanoJan 22, 2018
  29. Randall S. BeckerJan 22, 2018
  30. Junio C HamanoJan 23, 2018
  31. Randall S. BeckerJan 23, 2018
  32. Randall S. BeckerJan 25, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.