GoogleServiceTestSetUp test isn't robust against interrupted test run

Bug #306246 reported by Francis J. Lacoste
10
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

Symptoms
========
 GoogleServiceTestSetup (canonical.launchpad.testing.tests.googleserviceharness)

Failure in test GoogleServiceTestSetup (canonical.launchpad.testing.tests.googleserviceharness)
Failed doctest test for canonical.launchpad.testing.tests.googleserviceharness.GoogleServiceTestSetup
  File "/home/buildbot/slaves/launchpad/full/build/lib/canonical/launchpad/testing/tests/googleserviceharness.py", line 18, in GoogleServiceTestSetup

----------------------------------------------------------------------
File "/home/buildbot/slaves/launchpad/full/build/lib/canonical/launchpad/testing/tests/googleserviceharness.py", line 25, in canonical.launchpad.testing.tests.googleserviceharness.GoogleServiceTestSetup
Failed example:
    assert not service_is_available() # Sanity check.
Exception raised:
    Traceback (most recent call last):
      File "/home/buildbot/slaves/launchpad/full/build/utilities/../lib/zope/testing/doctest.py", line 1360, in __run
        compileflags, 1) in test.globs
      File "<doctest canonical.launchpad.testing.tests.googleserviceharness.GoogleServiceTestSetup[2]>", line 1, in ?
        assert not service_is_available() # Sanity check.
    AssertionError

Diagnosis
=========

GoogleServiceTestSetup doesn't recover gracefully from an interrupted test run. The old process remains running and we are using a predictable port for it.

Possible fixes
==============

* Use a dynamic port (a stale service would waste resources but not break test runs)

* Kill off the old service more reliably even when a test run is interrupted

Changed in launchpad-foundations:
importance: Undecided → High
milestone: none → 2.1.12
status: New → Triaged
Changed in launchpad-foundations:
milestone: 2.1.12 → 2.2.1
Changed in launchpad-foundations:
importance: High → Low
milestone: 2.2.1 → none
importance: Low → High
Curtis Hovey (sinzui)
tags: added: tech-debt
Revision history for this message
Robert Collins (lifeless) wrote :

The behaviour enforced by the asserts is appropriate. However, an interrupted test run shouldn't leave the ephemeral service running, and we should be using ephemeral ports etc too. So I'm going to tweak the description.

tags: added: test-system
removed: lp-foundations
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.