Giter Site home page Giter Site logo

Comments (8)

dmwyatt avatar dmwyatt commented on July 23, 2024 3

I decided to look into this issue after just dealing with it for what seems like years.

What happens is that the tests run fine, but fail to delete the test database because of the other session(s) using database error. If you run the tests again, django prompts you to delete the test database before continuing. This is how I've always just dealt with it in the past.

All of my regular Django tests work fine, it is only tests run with behave-django that exhibit this issue.

  • Django 2.1.4
  • behave-django 1.1.0
  • PostgreSQL 10.1

I'll try and remember to come up with a minimal reproducing project soon.

from behave-django.

dmwyatt avatar dmwyatt commented on July 23, 2024 3

I can't remember if this is the solution to the problem I had when I originally commented on this issue, but I came across this issue again in my Googlin' and this time I have a solution to a very similar issue...or maybe even the same issue.

Add conn_max_age=0 to your database configuration in tests. I figured this out from this answer on SO.

from behave-django.

bittner avatar bittner commented on July 23, 2024

This is probably not related to behave-django as such. You'd have to provide more details, though, ideally steps to reproduce the error.

You may find more helpful hints in similar issues on the web, e.g.

The last issue suggests that the problem is related to Postgres alone, not even Django. At least the error message comes directly from there. Some other application may use your database while you run the tests.

Please let us know when you find the culprit, so others can profit too. I leave the issue open in the meantime.

from behave-django.

bittner avatar bittner commented on July 23, 2024

Closing this issue for lack of activity.

from behave-django.

bittner avatar bittner commented on July 23, 2024

That sounds like an interesting background for learning more about the issue. (Thanks for digging!)

Please also mention any other technology that may be involved (e.g. Selenium) and the environment that the failing tests are run in. (I guess, a successfully failing test project to reproduce the issue will exhibit all of that.)

behave-django isn't much "magic", it's mostly just glue code between test tools. I wouldn't be surprised to find a generic issue that can be reproduced without behave-django.

from behave-django.

nhill-cpi avatar nhill-cpi commented on July 23, 2024

@dmwyatt Did you look into this more? Just wondering b/c I'm running into the same error.

from behave-django.

dmwyatt avatar dmwyatt commented on July 23, 2024

No, I got caught up in another project that doesn't use behave. Once I get back to a behave-using project I'll be able to investigate.

from behave-django.

bittner avatar bittner commented on July 23, 2024

Thanks @dmwyatt!

Details to this setting are available from the Databases section in Django's documentation.

I'm closing this issue as sufficiently discussed.

from behave-django.

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.