Giter Club home page Giter Club logo

Comments (12)

eproxus avatar eproxus commented on August 27, 2024

If you have access to the machines (or architectures) in question, you could try to debug the error. The test case can be found here: https://github.com/eproxus/meck/blob/develop/test/meck_tests.erl#L922

My suggestion would be to run the test case in isolation first, to see if it still is a problem:

rebar eunit tests=cover_test

The next step would be to enable tracing on the functions called in the test, to see where it hangs. You can add this to the top of the test case:

cover_test() ->
    dbg:tracer(), dbg:p(all, call),
    [dbg:tpl(cover, F, x)|| F <- [compile, analyze]],
    [dbg:tpl(meck_test_module, F, x) || F <- [a, b, c]],
    [dbg:tpl(meck, F, x) || F <- [new, expect, unload]],
    dbg:tpl(filelib, is_file, x),
    ...

Then just run the test case again, preferably using the tests=... argument to Rebar to avoid tracing from the rest of the tests.

from meck.

eproxus avatar eproxus commented on August 27, 2024

Closing until further updates.

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

Actually I have some news here. It seems that the issue is still there, and I can reproduce it quite easily on one machine I have access to (PPC64 achitecture). Interesting thing is that the issue is rather floating - take a look at the failure arch matrix from two different build attempts:

I'll post update in a few days.

from meck.

eproxus avatar eproxus commented on August 27, 2024

@lemenkov Is it the same error? I can't seem to find the build log for those new builds...

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

@eproxus I believe it's almost the same (unfortunately failed build logs are getting disposed rather fast in Fedora Project). "Almost", because I see some difference - I've got an io premature shutdown failure (very similar to this one - https://stackoverflow.com/questions/6491897/erlang-spawn-problems/6499774#6499774 ) instead of getting timeout.

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

I'll post new logs shortly.

from meck.

eproxus avatar eproxus commented on August 27, 2024

Would like new logs since the last ones are four year old 😄 A lot happened in Meck after that (including changing build system to Rebar 3)

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

Sorry for being late. Expect a fix soon.

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

Yes, this cannot be reproduced with Rebar3, so this issue is related to Rebar2. I cannot find a specific reason for behaving like that, but finally found a fix. Apparently Rebar2 ion these arches doesn't like when you do meck:new(...) followed by meck:unload(). It must be moved into a fixture (foreach).

This is a Rebar2-specific issue, and I cannot reproduce it with a Rebar3. Also I tested patched version with Rebar3 on my PPC64 - it works. And since it doesn't hurt any Rebar3 user so why not to apply it? :)

from meck.

eproxus avatar eproxus commented on August 27, 2024

What is the actual error? Just timeouts?

from meck.

lemenkov avatar lemenkov commented on August 27, 2024

@eproxus that's the tricky question. And I still can't answer.

I wasn't able to pinpoint an exact issue, but it seems that on some architectures (can't say Big-Endian), rebar can run tests in the way they can interfere with each other. I believe this indeed has something with timeouts. All the trests are running fine if running test-suites separately.

What I've changed is a very little thing. I've reorganized test-cases in two test-suites so they now have setup/teardown functions where all meck:new(...) / meck:unload() happens. So no meck:new(...) / meck:unload() can happen in the middle of other tests (?) or in any other unwanted time. This fixes the issue.

To sum up:

  • something shut down io server during meck_tests:cover_test() on some architectures when using rebar2.
  • reorganization of a two test-suites from a bunch of isolated test-cases framed with meck:new(..) / meck:unload() calls into a test-suite with setup/teardown apparently helped rebar2 to run all of the tests properly.

from meck.

eproxus avatar eproxus commented on August 27, 2024

Yeah, this whole thing seems very messy. Fortunately, the refactoring doesn't really change anything and in fact the suites contain less repetition 😄

Thanks for doing the research, I'll merge it. Let me know how it works!

from meck.

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.