Skip to content

cascade included-configs introduce duplicated requests #1947

@wuxudong

Description

@wuxudong

Minimal demo to reproduce::

test_common.yml:

scenarios:
  test_common:
    requests:
      - url: http://httpbin.org/get
        label: do_nothing.${__UUID()}
        jsr223:
          - language: groovy
            script-text: |
              log.info("do something with ${id}");
            execute: before

test_1.yml

included-configs:
  - test_common.yml

scenarios:
  test_1:
    requests:
      - set-variables:
          id: test1
      - include-scenario: test_common

test_2.yml

included-configs:
  - test_common.yml

scenarios:
  test_2:
    requests:
      - set-variables:
          id: test2
      - include-scenario: test_common

test_3.yml

included-configs:
  - test_1.yml
  - test_2.yml

scenarios:
  hello:
    requests:
      - include-scenario: test_1
      - include-scenario: test_2

execution:
  - scenario: hello

When running bzt test_3.yml, the messages "do something with test1" and "do something with test2" are printed twice in jmeter.log:

2025-12-24 15:20:19,190 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : hello
2025-12-24 15:20:19,190 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group hello.
2025-12-24 15:20:19,190 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2025-12-24 15:20:19,192 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=0 delayedStart=false
2025-12-24 15:20:19,212 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2025-12-24 15:20:19,212 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2025-12-24 15:20:19,223 INFO o.a.j.t.JMeterThread: Thread started: hello 1-1
2025-12-24 15:20:19,236 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:19,236 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:19,237 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:19,238 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:19,238 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:19,238 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:19,982 INFO o.a.j.m.J.JSR223PreProcessor: do something with test1
2025-12-24 15:20:20,002 INFO o.a.j.p.h.s.HTTPHCAbstractImpl: Local host = U-6TYQQVK3-2029.local
2025-12-24 15:20:20,009 INFO o.a.j.p.h.s.HTTPHC4Impl: HTTP request retry count = 0
2025-12-24 15:20:20,011 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2025-12-24 15:20:20,011 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to UTF-8
2025-12-24 15:20:20,011 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2025-12-24 15:20:20,011 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2025-12-24 15:20:20,241 INFO o.a.j.p.h.p.BaseParser: Created org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2025-12-24 15:20:20,253 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,254 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,254 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,254 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,254 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,254 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,255 INFO o.a.j.m.J.JSR223PreProcessor: do something with test1
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,311 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,346 INFO o.a.j.m.J.JSR223PreProcessor: do something with test2
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CacheManager Cache superseded by Cache
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing CookieManager Cookies superseded by Cookies
2025-12-24 15:20:20,355 WARN o.a.j.p.h.s.HTTPSamplerBase: Existing DNSCacheManager DNS Cache Manager superseded by DNS Cache Manager
2025-12-24 15:20:20,355 INFO o.a.j.m.J.JSR223PreProcessor: do something with test2
2025-12-24 15:20:20,357 INFO o.a.j.t.JMeterThread: Thread is done: hello 1-1
2025-12-24 15:20:20,357 INFO o.a.j.t.JMeterThread: Thread finished: hello 1-1
2025-12-24 15:20:20,361 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2025-12-24 15:20:20,361 INFO o.a.j.e.StandardJMeterEngine: Forced JVM shutdown requested at end of test

After digging into the code, I found the following in bzt/engine.py.
In the first loop of engine.configure

Image

Then, in the second loop of engine.configure

Image

The final included_configs list contains test_common.yml twice.

Using a set to deduplicate the included-configs entries can fix this issue.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions