jmeter-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 62887] SampleLabel displays incorrectly in Jmeter 5.0
Date Tue, 06 Nov 2018 19:13:27 GMT

--- Comment #5 from Alan Silva <> ---
So while running the unit tests, I noticed that the HTTPSamplerBase (and other
samplers perhaps), use a pattern of:

public SampleResult sample() {
    SampleResult res = null;
    try {
        res = sample(getUrl(), getMethod(), false, 0);
        if (res != null) {
        return res;
    } catch (Exception e) {
        return errorResult(e, new HTTPSampleResult());

Meaning, the sampler's name gets inserted to the SampleResult before returning.
So I can't really check for subResult.getSampleLabel().isEmpty() since it will
most likely won't be.

Also, I noticed that the subResult currently just uses it's parent Result's

So I tried applying the attached patch which just checks if the subResult has
the same label as its parent result object.
If it does, I let the rename happen. 
Otherwise, I assume that the subResult's label was modified for a reason and
shouldn't be touched.

Unfortunately, it seems to be breaking some of the unit tests but at this
point, I honestly don't know if it be worthwhile to fix all of them for a
cosmetic change.
I already changed our internal code to not automatically assume the subResult
will have the same label as the parent with the existing
addSubResult(subResult, false) method and will probably leave it at that.

Feel free to close this ticket if you wish.

@Philippe Mouawad
Simply make two SampleResult objects X and Y and try to add Y as a subResult of
X with X.addResult(Y)
You'll see that Y will always have the same name as X even if you call
Y.setSampleLabel("foo") or something.

You are receiving this mail because:
You are the assignee for the bug.
View raw message