Skip to content

improper __destruct() in Codeception\Extension\HttpMock #4

@JiankangMai

Description

@JiankangMai

I receive a failure that "Address is already in use".
I trace some code,found extensions(like Codeception\Extension\HttpMock) of codeception was instantiated more than once(each suite start and the global test boot).And you just clean the http-mock in the uncontrollable __destruct();
Now I fixed it by following code.and it run correctly now;

public static $events = [
        Events::SUITE_BEFORE => 'startHttpMock',
        Events::SUITE_AFTER  => 'stopHttpMock'
    ];

Perhaps it's because I use codeception2.2.7,not 2.1.* ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions