Code Monkey home page Code Monkey logo

Comments (5)

davidyaha avatar davidyaha commented on August 21, 2024

Hey @veeramarni!

Thanks for taking a look here!

Just to clarify as this test is in the current test suite that's passing.
If you run the whole test suite that works?
Could you maybe try uncommenting the code back and just use it.only in order to run the one test?

from graphql-redis-subscriptions.

veeramarni avatar veeramarni commented on August 21, 2024

Yes, basically with all tests it running fine. But the tests that I have pointed were failing. It could be just the test case that was having the issue.

from graphql-redis-subscriptions.

davidyaha avatar davidyaha commented on August 21, 2024

Hmm 🤔
Okay thanks for reporting this issue.
I'll try out when I have a bit more time for maintenance.

Do you see the issue when actually using asynciterator methods?

from graphql-redis-subscriptions.

itsJess1ca avatar itsJess1ca commented on August 21, 2024

I've noticed issues with the integration tests myself when working on #108 locally.

When running npm test the Integration tests simply return the following

1) PubSubAsyncIterator should allow subscriptions:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I noticed when submitting the PR that jenkins successfully ran those integration tests so wanted to give a bit more information on my environment in case that's relevant.
Node version: 8.9.1
Windows 10
Installation steps before running tests:

  • git clone
  • npm install
  • npm test

from graphql-redis-subscriptions.

jonas-app avatar jonas-app commented on August 21, 2024

Possible cause:
const iterator = pubSub.asyncIterator(eventName);
The subscription takes some time. Even if the promises resolve immediately it waits for the next tick.
If the publish happens right after the call to asyncIterator the global listener is still undefined.
const publishSpy = spy((channel, message) => listener && listener(channel, message));
If all tests are running the reused global listener might already be set.

setTimeout(() => pubSub.publish(eventName, { test: true }), 0)
Should fix the tests but I'm not sure if that is the most elegant solution.

from graphql-redis-subscriptions.

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.