#36652: Loading squashed migrations from disk raises CircularDependencyError
indeterministically
--------------------------------+------------------------------------------
     Reporter:  Jayden Kneller  |                    Owner:  Augusto Pontes
         Type:  Bug             |                   Status:  assigned
    Component:  Migrations      |                  Version:  dev
     Severity:  Normal          |               Resolution:
     Keywords:  squashed        |             Triage Stage:  Accepted
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+------------------------------------------
Comment (by Augusto Pontes):

 Replying to [comment:27 허진수]:
 > If i've understood correctly, the order can be fixed with PYTHONHASHSEED
 env variable. Because Python iterates over set using the location of each
 items, and it is based on the hash value. Python also uses seed to
 randomize the hash results.
 >
 > So, it's possible to test using `PYTHONHASHSEED` and `subprocess`. So we
 just need to find the value that causes CircularDependencyError.
 > Here is simple example.
 >
 >
 > {{{
 > class SomeTestClass(TestCase):
 >     def test():
 >         ...
 >
 > #####
 > # other file
 > #####
 > def some_test_method():
 >     env_vars = os.environ.copy()
 >     env_vars['PYTHONHASHSEED'] = '0'
 >     result = subprocess.run(
 >         [sys.executable, '-m', 'unittest', 'test_file.py'],
 >         env=env_vars,
 >         capture_output=True,
 >         text=True
 >     )
 > }}}
 >
 > I'm not sure if the result will be same, given a fixed `PYTHONHASHSEED`
 env variable.
 > If something wrong here, please tell me.
 > And sry for my bad english:(
 > Actually It's my first time on open source:)

 Great suggestion, i recommend you to analyze the README on the repo of
 jayden, i read, and the problem is a little bit deeper, on what i
 understood, is that jayden already solved the problem, with some
 adjustments on the code, and for now we are doing unit tests, and he is
 analyzing performance issues that can happen in the future or on other big
 applications, we are discussing on the official discord server, you can
 join using this link:

 https://discord.com/channels/856567261900832808/1428096388608299155
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36652#comment:28>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070199f09d135a-4d9c1070-7d25-47c9-8a9b-b69474f149ea-000000%40eu-central-1.amazonses.com.

Reply via email to