Intermittent failure: test_estimated_runtime_sets_start_time_when_unavailable

Bug #1757067 reported by Björn Tillenius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Björn Tillenius

Bug Description

I had an intermittent test failure when trying to land a branch:

  http://maas-ci-jenkins.internal:8080/job/maas/job/branch-tester/1982/consoleText

======================================================================
ERROR: metadataserver.models.tests.test_scriptresult.TestScriptResult.test_estimated_runtime_sets_start_time_when_unavailable
----------------------------------------------------------------------
Traceback (most recent call last):
testtools.testresult.real._StringException: Empty attachments:
  Twisted logs

Traceback (most recent call last):
  File "/run/build/maas/src/maastesting/runtest.py", line 138, in _run_user
    result = function(*args, **kwargs)
  File "/home/ubuntu/.buildout/eggs/testtools-2.2.0-py3.6.egg/testtools/testcase.py", line 719, in _run_test_method
    return self._get_test_method()()
  File "/run/build/maas/src/metadataserver/models/tests/test_scriptresult.py", line 484, in test_estimated_runtime_sets_start_time_when_unavailable
    self.assertEquals('0:00:00', script_result.estimated_runtime)
  File "/run/build/maas/src/maasserver/models/cleansave.py", line 118, in __getattribute__
    return super(CleanSave, self).__getattribute__(name)
  File "/run/build/maas/src/metadataserver/models/scriptresult.py", line 158, in estimated_runtime
    script_result.save(update_fields=['started'])
  File "/run/build/maas/src/metadataserver/models/scriptresult.py", line 376, in save
    return super().save(*args, **kwargs)
  File "/run/build/maas/src/maasserver/models/cleansave.py", line 203, in save
    return super(CleanSave, self).save(*args, **kwargs)
  File "/run/build/maas/src/maasserver/models/timestampedmodel.py", line 60, in save
    if self.pk is None or (_created is None and self.created is None):
  File "/run/build/maas/src/maasserver/models/cleansave.py", line 118, in __getattribute__
    return super(CleanSave, self).__getattribute__(name)
  File "/run/build/maas/src/maasserver/models/cleansave.py", line 69, in __get__
    "Accessing deferred field is not allowed: %s" % self.field_name)
maasserver.models.cleansave.DeferredValueAccessError: Accessing deferred field is not allowed: created

Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.4.x
tags: added: intermittent-failure
Revision history for this message
Björn Tillenius (bjornt) wrote :

I fixed it with this patch, since it was failing on every test run I did:

  https://paste.ubuntu.com/p/hfx6Z8G2XJ/

Revision history for this message
Björn Tillenius (bjornt) wrote :

The patch above got landed as part of commit a356a312101d2f9af69f32110bb47fb6f52f9361

Changed in maas:
assignee: nobody → Björn Tillenius (bjornt)
status: Triaged → Fix Committed
Changed in maas:
milestone: 2.4.x → 2.4.0beta2
Changed in maas:
milestone: 2.4.0beta2 → 2.4.0beta1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.