Code Monkey home page Code Monkey logo

Comments (1)

tcormackMW avatar tcormackMW commented on June 2, 2024

I don't think this is purely a race condition... If instead of the assertion, you waited on the state changing to ACTIVE, like below:

        while (compConfigs.at(0).state != scr::dto::ComponentState::ACTIVE)
        {
            compConfigs = GetComponentConfigs(testBundle, componentName, compDescDTO);
        }

The failing instance of the test case would never finish... i.e. this is not just 'we checked before some thread finished'

Additionally, when we first hit the while-loop, the componentConfig state is UNSATISFIED_REFERENCE and then it changes to a SATISFIED_REFERENCE but not an ACTIVE one.

There is no direct transition from UNSATISFIED_REFERENCE to ACTIVE, but there is from SATISFIED_REFERENCE to ACTIVE upon activation.

Additionally...

If you added the line GetInstance<test::CAInterface>(); as already existed 5 lines prior to this loop such that the loop looks like:

        while (compConfigs.at(0).state != scr::dto::ComponentState::ACTIVE)
        {
            instance = GetInstance<test::CAInterface>();
            compConfigs = GetComponentConfigs(testBundle, componentName, compDescDTO);
        }

the test no longer fails. When the loop is entered, the state of the compConfig[0] is UNSATISFIED_REFERENCE but after the two lines inside the while loop, it has changed to ACTIVE...

I'm not totally sure why this is happening... but I think it has to do with somehow DS not recording that an instance of the service was requested the first time through

from cppmicroservices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.