﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36997	test_double_replaced_migrations_are_checked_correctly fails intermittently under Windows Subsystem for Linux (WSL)	Stewart Matheson		"Under WSL running Ubuntu 24.04 I am seeing intermittent test failures on 


{{{
migrations.test_commands.SquashMigrationsTests.test_double_replaced_migrations_are_checked_correctly
}}}


The failure message I get is


{{{
ERROR: test_double_replaced_migrations_are_checked_correctly (migrations.test_commands.SquashMigrationsTests.test_double_replaced_migrations_are_checked_correctly)
If replaced migrations are already applied and replacing migrations
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/home/stewart/code/open-source/python/install/3.14.3/lib/python3.14/unittest/case.py"", line 58, in testPartExecutor
    yield
  File ""/home/stewart/code/open-source/python/install/3.14.3/lib/python3.14/unittest/case.py"", line 669, in run
    self._callTestMethod(testMethod)

  File ""/home/stewart/code/open-source/python/install/3.14.3/lib/python3.14/unittest/case.py"", line 615, in _callTestMethod
    result = method()
    ^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/tests/migrations/test_commands.py"", line 3246, in test_double_replaced_migrations_are_checked_correctly
    call_command(""migrate"", ""migrations"", interactive=False, verbosity=0)
    ^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/core/management/__init__.py"", line 195, in call_command
    return command.execute(*args, **defaults)
      ^^^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/core/management/base.py"", line 466, in execute
    output = self.handle(*args, **options)
    ^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/core/management/base.py"", line 113, in wrapper
    res = handle_func(*args, **kwargs)
    ^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/core/management/commands/migrate.py"", line 115, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
    ^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/db/migrations/executor.py"", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
    ^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/db/migrations/loader.py"", line 59, in __init__
    self.build_graph()
    ^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/db/migrations/loader.py"", line 282, in build_graph
    self.load_disk()
    ^^^^^^^^^^^^^^^
  File ""/home/stewart/code/open-source/django/source/django/db/migrations/loader.py"", line 87, in load_disk
    module = import_module(module_name)
    ^^^^^^^
  File ""/home/stewart/code/open-source/python/install/3.14.3/lib/python3.14/importlib/__init__.py"", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
      ^^^^^^^^^^^^^^^^^
  File ""<frozen importlib._bootstrap>"", line 1398, in _gcd_import
  File ""<frozen importlib._bootstrap>"", line 1371, in _find_and_load
  File ""<frozen importlib._bootstrap>"", line 1335, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tmpx72x4ve0.migrations'
}}}

This failure is intermittent however I'm able to trigger it around 90% of the time I run the test.

Steps to reproduce 

1. Create New Ubuntu Machine under WSL
2. Install python 3.14.3.
3. Follow the guide here https://docs.djangoproject.com/en/6.0/intro/contributing/ to the point of executing tests with the runtests.py runner.
4. Observe the above failure.

"	Bug	closed	Migrations	dev	Normal	needsinfo		gghez	Unreviewed	1	0	0	0	0	0
