Giter VIP home page Giter VIP logo

Comments (7)

ackintosh avatar ackintosh commented on June 4, 2024

Hi @chengangcode , thank you for reporting this issue.

I've run the tests locally with latest master but the failures aren't reproduced.

$ docker-compose up
Starting mongo     ... done
Starting redis     ... done
Starting memcached ... done
Starting server    ... done
Starting client    ... done
...
...

$ docker-compose run --rm -w /tmp/ganesha -u ganesha client vendor/bin/phpunit
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

...............................................................  63 / 102 ( 61%)
.......................................                         102 / 102 (100%)

Time: 39.12 seconds, Memory: 14.00MB

OK (102 tests, 160 assertions)

Could you please let me know the versions you are using? (Ganesha, PHP, OS)

from ganesha.

happylhb avatar happylhb commented on June 4, 2024

Builder::buildWithCountStrategy use RedisAdapter

docker-compose run --rm -w /tmp/ganesha -u ganesha client vendor/bin/phpunit Ackintosh/GaneshaTest /tmp/ganesha/tests/Ackintosh/GaneshaTest.php
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

FFF.FFFF. 9 / 9 (100%)

Time: 928 ms, Memory: 8.00MB

There were 7 failures:

  1. Ackintosh\GaneshaTest::recordsFailureAndTrips
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:42

  1. Ackintosh\GaneshaTest::recordsSuccessAndClose
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:55

  1. Ackintosh\GaneshaTest::notifyTripped
    Expectation failed for method name is equal to string:receive when invoked 1 time(s).
    Method was expected to be called 1 times, actually called 0 times.

  2. Ackintosh\GaneshaTest::failureCountMustNotBeNegative
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:116

  1. Ackintosh\GaneshaTest::withIntervalToHalfOpen
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:132

  1. Ackintosh\GaneshaTest::disable
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:152

  1. Ackintosh\GaneshaTest::reset
    Failed asserting that true is false.

/tmp/ganesha/tests/Ackintosh/GaneshaTest.php:169

FAILURES!
Tests: 9, Assertions: 14, Failures: 7.

from ganesha.

happylhb avatar happylhb commented on June 4, 2024

@ackintosh

from ganesha.

ackintosh avatar ackintosh commented on June 4, 2024

@happylhb Thanks your comment. You mean that the unit tests fails if we set Redis adapter here instead of the Memcached adapter?

from ganesha.

happylhb avatar happylhb commented on June 4, 2024

@ackintosh yes

from ganesha.

ackintosh avatar ackintosh commented on June 4, 2024

@happylhb Unfortunately Redis Adapter doesn't support the Count strategy for now. 😢

public function save($resouce, $count)
{
// Redis adapter does not support Count strategy
}

public function decrement($service)
{
// Redis adapter does not support Count strategy
}

From your comment, I've noticed we should update that make Ganesha throws Exception if using Redis Adapter with the counting strategy so that users can notice that is unsupported. 💡

from ganesha.

ackintosh avatar ackintosh commented on June 4, 2024

Now we can notice that an adapter doesn't support the strategy as an exception is thrown if so.
#36

And I've opened the issue to track the status of a support for Redis + Count.
#37

from ganesha.

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.