Skip to content

Reconnect param on 3.0.1 #22

Closed
Closed

Description

@borutainfo

Hi,

my tests fails after update version from 3.0.0 to 3.0.1. Issue:
[Warning] Undefined array key "reconnect" at /var/www/html/vendor/codeception/module-amqp/src/Codeception/Module/AMQP.php:103

It is about this line:

if ($this->config['reconnect']) {
    $this->getChannel()->getConnection()->reconnect();
}

There is no reconnect param. Can you fix this i.e. by adding isset call?

Activity

  1. W0rma commented on Dec 5, 2025

    @W0rma
    Contributor

    I can not reproduce this issue in my own project.

    The module even defines a default value for "reconnect" here.

    Which version of Codeception do you use?

  2. borutainfo commented on Dec 5, 2025

    @borutainfo
    Author

    Hi, sorry, I wasn't precise enough.

    The issue in AMQP.php is indirect, and the class itself doesn't cause the error on its own.

    In my case, however, the AMQP class is extended and the default configuration is overridden, so the reconnect parameter is missing. I realize that with custom implementations one has to adapt to upstream changes, but I don't think anyone expects breaking changes when updating a package at the patch level (from 3.0.0 to 3.0.1). In a test environment, a warning often interrupts execution and fails the tests.

    The class isn't marked as final, and the $config isn't private, so I suspect there may be similar implementations elsewhere.

    So, this is just something to consider, not a critical must-have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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