Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test when handling a channel failure #53

Open
zlintz opened this issue Jan 25, 2024 · 2 comments
Open

Failing test when handling a channel failure #53

zlintz opened this issue Jan 25, 2024 · 2 comments

Comments

@zlintz
Copy link
Member

zlintz commented Jan 25, 2024

See the discussion here #16 for context.

In src/connectionFsm.js there is a todo to figure out why the commented out code is causing test failures. It

Failures seen here:

https://github.com/Foo-Foo-MQ/foo-foo-mq/actions/runs/7660491629/job/20877897843#step:8:423

222 passing (14s)
3 failing

  1. Adding Queues
    when the queue does not already exist
    should error on addQueue in passive mode:
    AssertionError: expected 'Error: Failed to create queue 'no-qu…' to include 'Failed to create queue 'no-queue-her…'
    at /home/runner/work/foo-foo-mq/foo-foo-mq/spec/integration/addPassiveQueue.spec.js:2:940
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  2. Bad Connection
    when attempting a connection
    should fail to connect:
    TypeError: Cannot read properties of undefined (reading 'should')
    at Context. (spec/integration/badConnection.spec.js:2:1022)
    at process.processImmediate (node:internal/timers:476:21)

  3. Bad Connection
    when attempting a uri connection with an invalid password
    should fail to connect:
    TypeError: Cannot read properties of undefined (reading 'should')
    at Context. (spec/integration/badConnection.spec.js:2:2046)
    at process.processImmediate (node:internal/timers:476:21)

@MartianH
Copy link

MartianH commented Apr 5, 2024

@zlintz there is some type of race condition when running the spec/integration tests. I have a separate branch where I rewrote the project in ESM with amqplib: ~0.10.3 and am seeing the same problem. Once you run the tests one by one, they all pass.

Steps should be taken to rewrite the setup and teardown parts to avoid this. As of now, there is a single spec/setup.js that is imported in every test case that provides globals, which is an outdated and ill-advised pattern. I am pretty sure this is where the problem lies.

@zlintz
Copy link
Member Author

zlintz commented Sep 21, 2024

You are probably correct. Things (test) are not written to be parallel currently is my conclusion. Do you have a proposal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants