Requesting help with failure finding DiscourseRedis::Connector running tests

For the past some days, when I try to run tests locally, I am getting this error:

$ bundle exec rake autospec

...

An error occurred while loading ./spec/components/discourse_redis_spec.rb.
Failure/Error:
    describe DiscourseRedis::Connector do
      let(:connector) { DiscourseRedis::Connector.new(config) }
  
      after do
        fallback_handler.master = true
      end
  
      it 'should return the master config when master is up' do
        expect(connector.resolve).to eq(config)
      end

NameError:
  uninitialized constant DiscourseRedis::Connector
  Did you mean?  ConnectionPool

I’m not aware of what I might have inadvertently changed so that my system can no longer run tests. Redis is definitely running, so it’s not a side effect of redis not running.

I get this even when running tests on a clean checkout of tests-passed so it’s something about my environment, but I don’t know where to look first.

Any suggestions?

2 Likes

It looks like we managed to check in broken specs. I’ve disabled the broken specs in this commit:

https://github.com/discourse/discourse/commit/b1114b9a20343525c805d7339bd64954965a12f9

But we have two follow up items:

  1. Fix the broken specs
  2. Make sure we can’t check these in again in the future.
2 Likes

Thanks for looking at this! Did the broken specs land on tests-passed because of intermittent problems?

I pulled, and on ac9577bcc7b69593bcdd204368d35492fc0cee15 I’m still seeing exactly the same error locally. So probably more than one problem. :confused:

Sorry, my bad. I forgot to push :facepalm: I’ve updated the previous post with the correct commit.

And yes it means broken tests made it into tests-passed. Fortunately Discourse itself is fine - it’s the tests that need to be updated not any bugs in our application. Still, we are going to stop this from happening in the future.

3 Likes

Been there done that! Tests are now happily running.

Sorry I didn’t ask earlier. I know I’m outside the mainstream Discourse developer since I’m working on Fedora not Ubuntu, so I have a bias to assume there’s some environmental variant on my machine that is just different. Thanks for unlocking my testing!

1 Like

I see there is disagreement about disabling those tests from commit 25db91e35180b2707ca4a9f7ffd173823f86f18d reverting you.

But it’s not because it is followed up by fixing the problem, because I tested at d775338d637d9ef3843acf227a138e8f11352151 which is master and tests-passed as of the moment I pulled, and the problem is back.

At least I got my tests passing locally and worked out what I had to do differently to handle the new safety mechanisms that I put into the migrate script.

@tgxworld what’s the plan for resolving the conflict? I guess I can just cherry-pick b1114b9a20343525c805d7339bd64954965a12f9 temporarily onto the base of my branch when I need to test in the meantime?

1 Like

The tests were meant to be removed and I didn’t catch it because our CI had a bug where it wasn’t falling when it encounters an error. This has been fixed in

https://github.com/discourse/discourse/commit/add2a9411e7bb26b133a12bacc11a47c43e6f648

3 Likes