Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Intermittent migration test failure on master #2222

Closed
jaredlockhart opened this issue Apr 27, 2020 · 1 comment
Closed

Intermittent migration test failure on master #2222

jaredlockhart opened this issue Apr 27, 2020 · 1 comment

Comments

@jaredlockhart
Copy link
Collaborator

Just ran make check on master@6154a7f25c8c731c13a9faa54dcf6d16afb6d8f2 and got this test failure, ran make check again and it passed:

_______________________________________________________________________ Test0007FilterConversion.test_reverse ________________________________________________________________________

self = <normandy.recipes.tests.test_migrations.Test0007FilterConversion object at 0x7f054a1c4450>
migrations = <normandy.conftest.migrations.<locals>.Migrator object at 0x7f05493da810>

    def test_reverse(self, migrations):
        # Get the pre-migration models
        old_apps = migrations.migrate("recipes", "0007_convert_simple_filters_to_filter_objects")
        Recipe = old_apps.get_model("recipes", "Recipe")
        Action = old_apps.get_model("recipes", "Action")
        RecipeRevision = old_apps.get_model("recipes", "RecipeRevision")
        Channel = old_apps.get_model("recipes", "Channel")
        Country = old_apps.get_model("recipes", "Country")
        Locale = old_apps.get_model("recipes", "Locale")
    
        # Create test data
        recipe = Recipe.objects.create()
        action = Action.objects.create()
        channel1 = Channel.objects.create(slug="beta")
        channel2 = Channel.objects.create(slug="release")
        country1 = Country.objects.create(code="US")
        country2 = Country.objects.create(code="CA")
>       locale1 = Locale.objects.create(code="en-US")

normandy/recipes/tests/test_migrations.py:313: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/venv/lib/python3.7/site-packages/django/db/models/manager.py:82: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
/opt/venv/lib/python3.7/site-packages/django/db/models/query.py:422: in create
    obj.save(force_insert=True, using=self.db)
/opt/venv/lib/python3.7/site-packages/django/db/models/base.py:741: in save
    force_update=force_update, update_fields=update_fields)
/opt/venv/lib/python3.7/site-packages/django/db/models/base.py:790: in save_base
    update_fields=update_fields, raw=raw, using=using,
/opt/venv/lib/python3.7/site-packages/django/dispatch/dispatcher.py:175: in send
    for receiver in self._live_receivers(sender)
/opt/venv/lib/python3.7/site-packages/django/dispatch/dispatcher.py:175: in <listcomp>
    for receiver in self._live_receivers(sender)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sender = <class '__fake__.Locale'>, instance = <Locale: Locale object (214)>
kwargs = {'created': True, 'raw': False, 'signal': <django.db.models.signals.ModelSignal object at 0x7f05504f8c50>, 'using': 'default'}, update_fields = None

    def reset_state(sender, instance, **kwargs):
        # original state should hold all possible dirty fields to avoid
        # getting a `KeyError` when checking if a field is dirty or not
        update_fields = kwargs.pop('update_fields', {})
>       new_state = instance._as_dict(check_relationship=True)
E       AttributeError: 'Locale' object has no attribute '_as_dict'

/opt/venv/lib/python3.7/site-packages/dirtyfields/dirtyfields.py:136: AttributeError
@mythmon
Copy link
Contributor

mythmon commented Apr 27, 2020

This is the same as #2219.

@mythmon mythmon closed this as completed Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants