Code Monkey home page Code Monkey logo

Comments (4)

Victoria91 avatar Victoria91 commented on August 26, 2024 1

Here is shortened version of test that still reproduces the error, I hope It will be engouh.

Here is is sample of failed test output

  1) test #init assert 6 (MyAppRouter.ConsumerListenerTest)
     test/consumer_listener_test.exs:101
     ** (MatchError) no match of right hand side value: false
     code: with_mocks(mocks) do
     stacktrace:
       test/consumer_listener_test.exs:104: anonymous fn/2 in MyAppRouter.ConsumerListenerTest."test #init assert 6"/1
       (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
       test/consumer_listener_test.exs:104: (test)

And one more detail: Our project uses umbrella. The case with flicker failing tests reporoduces only when running tests from the root direcrory of the whole project. When running from the directory of the application with specific test - the test always pass

from mock.

Olshansk avatar Olshansk commented on August 26, 2024

So is the same test failing/passing ephemerally?

Could you provide some example code so we can debug together?

from mock.

Olshansk avatar Olshansk commented on August 26, 2024

Hmm...

Given that you said this: When running from the directory of the application with specific test - the test always pass and looking at the test you pasted, the only theory I have is that your tests are asynchronous, so there's a weird race condition happening when you are trying to mock things.

Can you try updating this line with use ExUnit.Case, async: true and see if the error persists?

Reference: https://hexdocs.pm/ex_unit/ExUnit.Case.html

from mock.

Victoria91 avatar Victoria91 commented on August 26, 2024

No, tests are not asynchronous, if add async: true, that way they will be asynchronous and they won't pass at all but with other errors.
Sorry for late reply

from mock.

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.