[Buildbot-devel] possible bug in ShellCommand, Test and PerlModuleTest

June Kim juneaftn at gmail.com
Mon Oct 13 14:37:32 UTC 2008


Hello,

I think I found a potential bug in buildbot.

When I use buildbot.steps.shell.Test step, the text result seen on the
waterfall page is accumulated. For example, if I had the following
simple factory

f1 = factory.BuildFactory()
f1.addStep(Test(command=["echo", "hello"]))

and set a periodic scheduler for every 10 secs, the text in the build
cell of the waterfall display(or any other displays) is accumulated as
the builds go one after another.


It goes like the following:

test
no test results

Build 1

test
no test results
no test results

Build 2

And the descriptive text is infinitely extended.

I think the bug resides in the interaction between ShellCommand class
and its child Test class.

Test class calls its parent's method "describe", in which the instance
attribute is modified with side-effects.

class Test(...
    def describe(self, done=False):
        description = WarningCountingShellCommand.describe(self, done)

WarningCountingShellCommand.describe isn't existent and hence its
parent's method ShellCommand.describe is called. However, the
following lines in ShellCommand.describe returns the instance
attributes and Test.describe modifies(actually, adds textual
descriptions) it:

(in ShellCommand.describe)
        if done and self.descriptionDone is not None:
            return self.descriptionDone
        if self.description is not None:
            return self.description


Therefore, self.description is infinitely added with later
descriptions. I changed the code above into as following to resolve
the bug:

(in ShellCommand.describe)
        if done and self.descriptionDone is not None:
            return self.descriptionDone[:]
        if self.description is not None:
            return self.description[:]




More information about the devel mailing list