l.c.p.t.t.TestPullerMonitorProtocol(ProcessTestsMixin, TestCase) : class documentation

Part of lp.codehosting.puller.tests.test_scheduler View In Hierarchy

Tests for the process protocol used by the job manager.
Class StubPullerListener Stub listener object that records calls.
Method makeProtocol Construct an ProcessProtocol instance to be tested.
Method setUp Undocumented
Method assertProtocolSuccess Assert that the protocol saw no unexpected errors.
Method test_startMirroring Receiving a startMirroring message notifies the listener.
Method test_branchChanged Receiving a branchChanged message notifies the listener.
Method test_mirrorFailed Receiving a mirrorFailed message notifies the listener.
Method test_log Undocumented
Method assertMessageResetsTimeout Assert that sending the message resets the protocol timeout.
Method test_progressMadeResetsTimeout Receiving 'progressMade' resets the timeout.
Method test_startMirroringResetsTimeout Receiving 'startMirroring' resets the timeout.
Method test_branchChangedDoesNotResetTimeout Receiving 'branchChanged' doesn't reset the timeout.
Method test_mirrorFailedDoesNotResetTimeout Receiving 'mirrorFailed' doesn't reset the timeout.
Method test_terminatesWithError When the child process terminates with an unexpected error, raise
Method test_stderrFailsProcess If the process prints to stderr, then the Deferred fires an
Method test_prematureFailureWithoutStderr Undocumented
Method test_errorBeforeStatusReport Undocumented
Method test_errorBeforeStatusReportAndFailingMirrorFailed Undocumented

Inherited from ProcessTestsMixin:

Class StubTransport Stub process transport that implements the minimum we need.
Method simulateProcessExit Pretend the child process we're monitoring has exited.

Inherited from TestCase:

Method becomeDbUser Commit, then log into the database as dbuser.
Method __str__ The string representation of a test is its id.
Method useContext Use the supplied context in this test.
Method makeTemporaryDirectory Create a temporary directory, and return its path.
Method installKarmaRecorder Set up and return a KarmaRecorder.
Method assertProvides Assert 'obj' correctly provides 'interface'.
Method assertNotifies Assert that a callable performs a given notification.
Method assertNoNotification Assert that no notifications are generated by the callable.
Method assertSqlAttributeEqualsDate Fail unless the value of the attribute is equal to the date.
Method assertTextMatchesExpressionIgnoreWhitespace Undocumented
Method assertIsInstance Assert that an instance is an instance of assert_class.
Method assertIsNot Assert that expected is not the same object as observed.
Method assertContentEqual Assert that 'iter1' has the same content as 'iter2'.
Method assertRaisesWithContent Check if the given exception is raised with given content.
Method assertBetween Assert that 'variable' is strictly between two boundaries.
Method assertVectorEqual Apply assertEqual to all given pairs in one go.
Method expectedLog Expect a log to be written that matches the regex.
Method pushConfig Push some key-value pairs into a section of the config.
Method attachOopses Undocumented
Method attachLibrarianLog Include the logChunks from fixture in the test details.
Method assertStatementCount Assert that the expected number of SQL statements occurred.
Method useTempDir Use a temporary directory for this test.
Method assertEmailHeadersEqual Assert that two email headers are equal.
Method assertStartsWith Undocumented
Method assertEndsWith Asserts that s ends with suffix.
Method checkPermissions Check if the used_permissions match expected_permissions.
Method assertEmailQueueLength Pop the email queue, assert its length, and return it.
Method _unfoldEmailHeader Unfold a multiline email header.
def makeProtocol(self):
Construct an ProcessProtocol instance to be tested.

Override this in subclasses.

def setUp(self):
Undocumented
def assertProtocolSuccess(self):
Assert that the protocol saw no unexpected errors.
def test_startMirroring(self):
Receiving a startMirroring message notifies the listener.
def test_branchChanged(self):
Receiving a branchChanged message notifies the listener.
def test_mirrorFailed(self):
Receiving a mirrorFailed message notifies the listener.
def test_log(self):
Undocumented
def assertMessageResetsTimeout(self, callable, *args):
Assert that sending the message resets the protocol timeout.
def test_progressMadeResetsTimeout(self):
Receiving 'progressMade' resets the timeout.
def test_startMirroringResetsTimeout(self):
Receiving 'startMirroring' resets the timeout.
def test_branchChangedDoesNotResetTimeout(self):
Receiving 'branchChanged' doesn't reset the timeout.

It's possible that in pathological cases, the worker process might hang around even after it has said that it's finished. When that happens, we want to kill it quickly so that we can continue mirroring other branches.

def test_mirrorFailedDoesNotResetTimeout(self):
Receiving 'mirrorFailed' doesn't reset the timeout.

mirrorFailed doesn't reset the timeout for the same reasons as mirrorSucceeded.

def test_terminatesWithError(self):
When the child process terminates with an unexpected error, raise an error that includes the contents of stderr and the exit condition.
def test_stderrFailsProcess(self):
If the process prints to stderr, then the Deferred fires an errback, even if it terminated successfully.
def test_prematureFailureWithoutStderr(self):
Undocumented
def test_errorBeforeStatusReport(self):
Undocumented
@suppress_stderr
def test_errorBeforeStatusReportAndFailingMirrorFailed(self):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.