~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_breakin.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-26 21:11:03 UTC
  • mfrom: (2447.1.7 bundle_empty_properties)
  • Revision ID: pqm@pqm.ubuntu.com-20070426211103-h84prqh7a4ad3ez2
(John Arbash Meinel) Fix bug #109613 by teaching Bundle how to properly read/write revision properties with no value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                env_changes=dict(BZR_SIGQUIT_PDB=None))
58
58
        # wait for it to get started, and print the 'listening' line
59
59
        proc.stdout.readline()
60
 
        # break into the debugger
61
 
        os.kill(proc.pid, signal.SIGQUIT)
62
 
        # now send a second sigquit, which should cause it to exit.  That
63
 
        # won't happen until the original signal has been noticed by the
64
 
        # child and it's run its signal handler.  We don't know quite how long
65
 
        # this will take, but if it's more than 10s then it's probably not
66
 
        # going to work.
67
 
        for i in range(100):
68
 
            time.sleep(0.1)
69
 
            os.kill(proc.pid, signal.SIGQUIT)
70
 
            # note: waitpid is different on win32, but this test only runs on
71
 
            # unix
72
 
            r = os.waitpid(proc.pid, os.WNOHANG)
73
 
            if r != (0, 0):
74
 
                # high bit says if core was dumped; we don't care
75
 
                self.assertEquals(r[1] & 0x7f, signal.SIGQUIT)
76
 
                break
77
 
        else:
78
 
            self.fail("subprocess wasn't terminated by repeated SIGQUIT")
 
60
        # another hit gives the default behaviour of terminating it
 
61
        os.kill(proc.pid, signal.SIGQUIT)
 
62
        # wait for it to go into pdb
 
63
        time.sleep(.5)
 
64
        os.kill(proc.pid, signal.SIGQUIT)
 
65
        proc.wait()
79
66
 
80
67
    def test_breakin_disabled(self):
81
68
        proc = self.start_bzr_subprocess(self._test_process_args,