actions / runner-images

GitHub Actions runner images
MIT License
9.13k stars 2.82k forks source link

RSpec tests failing ActiveRecordError: "Cannot expire connection, it is owned by a different thread" with Ubuntu 20.04 (20240414) Image Update #9709

Closed tpodlipni closed 2 weeks ago

tpodlipni commented 2 weeks ago

Description

Starting a few days ago, we started seeing intermittent failures on our RSpec tests.

raise ActiveRecordError, "Cannot expire connection, " \
         "it is owned by a different thread: #{@owner}. " \
         "Current thread: #{Thread.current}."

While troubleshooting we rolled back to code that preceded the weekend and found that we were still seeing the errors. Wondering if there is anyone else out there who started seeing intermittent test failures with the same error.

Platforms affected

Runner images affected

Image version and build link

Runner Image: 20240414.1.0

Is it regression?

20240407.1.0

Expected behavior

All RSpec tests pass.

Actual behavior

Intermittent failures occurring where a test will fail with the following error:

raise ActiveRecordError, "Cannot expire connection, " \
         "it is owned by a different thread: #{@owner}. " \
         "Current thread: #{Thread.current}."

Repro steps

To reproduce this issue we just need to run our full RSpec test suite.

MaksimZhukov commented 2 weeks ago

Hello @tpodlipni! Could you please provide us with the minimal repro steps so that we can reproduce the issue from our side? It would be great if you could provide us with a link to the public repository where the issue occurs.

tpodlipni commented 2 weeks ago

@MaksimZhukov, this is for a private repository actually. Not sure if that precludes support in this case, but here is the link to the repo.

tpodlipni commented 2 weeks ago

Found a culprit in our code, but a bit buried. Closing out the issue.