Patchwork D11251: test-nointerrupt: make "sure" the handler "might" trigger (issue6558)

login
register
mail settings
Submitter phabricator
Date Aug. 4, 2021, 8:42 p.m.
Message ID <differential-rev-PHID-DREV-l2zo7j7una5r22s26vqt-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49564/
State Superseded
Headers show

Comments

phabricator - Aug. 4, 2021, 8:42 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We are sure that the signal got sent in the right time frame, however, we still
  have race, so either the code is actually buggy or we need some security to make
  sure the signal get processed.
  
  We might be affected by https://bugs.python.org/issue43406 ?

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11251

AFFECTED FILES
  tests/test-nointerrupt.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-nointerrupt.t b/tests/test-nointerrupt.t
--- a/tests/test-nointerrupt.t
+++ b/tests/test-nointerrupt.t
@@ -27,6 +27,8 @@ 
   >     with ui.uninterruptible():
   >         testing.write_file(sync_file, b'%d' % os.getpid())
   >         testing.wait_file(done_file)
+  >         # make sure we get rescheduled and the signal get a chance to be handled
+  >         time.sleep(0.1)
   >         ui.warn(b"end of unsafe operation\n")
   >     ui.warn(b"%d second(s) passed\n" % int(time.time() - start))
   > EOF
@@ -40,6 +42,7 @@ 
   > fi
   > "$RUNTESTDIR/testlib/wait-on-file" 10 "$SYNC_FILE" || exit 2
   > kill -s \$SIG \`cat "$SYNC_FILE"\`
+  > sleep 1
   > touch "$DONE_FILE"
   > EOF