New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spontaneous concurrent test failure: Do not manipulate content db schema in tests #5252

Closed
benjaoming opened this Issue Aug 5, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@benjaoming
Member

benjaoming commented Aug 5, 2016

Summary

During some of the unit tests, we are deleting the content db.

System information

Please specify the KA Lite version you were using and your operating system!

  • Operating system: Circle CI
  • Version: 0.16+

Traceback or relevant snippet from server.log

[ERROR] [2016-08-05 17:45:19,082] kalite: No content database file found
    Then the last in-progress video/exercise should be shown # kalite/distributed/features/steps/content_recommendation.py:18 0.029s
      Traceback (most recent call last):
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1173, in run
          match.run(runner.context)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1589, in run
          self.func(context, *args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/distributed/features/steps/content_recommendation.py", line 20, in impl
          assert get_content_item(content_id=context.videos[1].get("id")).get("path") in context.browser.current_url, "Last in progress video not in %s" % context.browser.current_url
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 128, in wrapper
          output = function(*args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 201, in get_content_item
          return model_to_dict(value)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/playhouse/shortcuts.py", line 110, in model_to_dict
          rel_obj = getattr(model, field.name)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1138, in __get__
          return self.get_object_or_id(instance)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1129, in get_object_or_id
          obj = self.rel_model.get(self.field.to_field == rel_id)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 4300, in get
          return sq.get()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2792, in get
          return clone.execute().next()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2839, in execute
          self._qr = ResultWrapper(model_class, self._execute(), query_meta)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2535, in _execute
          return self.database.execute_sql(sql, params, self.require_commit)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3339, in execute_sql
          self.commit()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3185, in __exit__
          reraise(new_type, new_type(*exc_args), traceback)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3331, in execute_sql
          cursor.execute(sql, params or ())
      OperationalError: no such table: item

How to reproduce

This happens only randomly

Screenshots

https://circleci.com/gh/learningequality/ka-lite/2519

@benjaoming benjaoming added the bug label Aug 5, 2016

@benjaoming benjaoming added this to the 0.16.9 milestone Aug 5, 2016

@benjaoming benjaoming self-assigned this Aug 5, 2016

@benjaoming benjaoming referenced this issue Aug 5, 2016

Merged

Bump version.yml a bit too late for the party #5251

3 of 3 tasks complete

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Sep 5, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Sep 5, 2016

@benjaoming benjaoming added the has PR label Sep 5, 2016

benjaoming added a commit that referenced this issue Sep 5, 2016

Merge pull request #5268 from benjaoming/testing-no-concurrent-conten…
…t-db-deletion

Fixes #5252 by removing testing of legacy functionality
@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Sep 5, 2016

Member

Fixed in #5268

Member

benjaoming commented Sep 5, 2016

Fixed in #5268

@benjaoming benjaoming closed this Sep 5, 2016

@benjaoming benjaoming removed the has PR label Sep 5, 2016

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Sep 6, 2016

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Sep 20, 2016

Member

Reopening because of similar occurrence:


    Then the last in-progress video/exercise should be shown # kalite/distributed/features/steps/content_recommendation.py:18 0.029s
      Traceback (most recent call last):
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1173, in run
          match.run(runner.context)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1589, in run
          self.func(context, *args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/distributed/features/steps/content_recommendation.py", line 20, in impl
          assert get_content_item(content_id=context.videos[1].get("id")).get("path") in context.browser.current_url, "Last in progress video not in %s" % context.browser.current_url
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 128, in wrapper
          output = function(*args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 201, in get_content_item
          return model_to_dict(value)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/playhouse/shortcuts.py", line 110, in model_to_dict
          rel_obj = getattr(model, field.name)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1138, in __get__
          return self.get_object_or_id(instance)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1129, in get_object_or_id
          obj = self.rel_model.get(self.field.to_field == rel_id)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 4300, in get
          return sq.get()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2792, in get
          return clone.execute().next()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2839, in execute
          self._qr = ResultWrapper(model_class, self._execute(), query_meta)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2535, in _execute
          return self.database.execute_sql(sql, params, self.require_commit)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3339, in execute_sql
          self.commit()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3185, in __exit__
          reraise(new_type, new_type(*exc_args), traceback)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3331, in execute_sql
          cursor.execute(sql, params or ())
      OperationalError: no such table: item
Member

benjaoming commented Sep 20, 2016

Reopening because of similar occurrence:


    Then the last in-progress video/exercise should be shown # kalite/distributed/features/steps/content_recommendation.py:18 0.029s
      Traceback (most recent call last):
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1173, in run
          match.run(runner.context)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/behave/model.py", line 1589, in run
          self.func(context, *args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/distributed/features/steps/content_recommendation.py", line 20, in impl
          assert get_content_item(content_id=context.videos[1].get("id")).get("path") in context.browser.current_url, "Last in progress video not in %s" % context.browser.current_url
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 128, in wrapper
          output = function(*args, **kwargs)
        File "/home/ubuntu/ka-lite/kalite/topic_tools/content_models.py", line 201, in get_content_item
          return model_to_dict(value)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/playhouse/shortcuts.py", line 110, in model_to_dict
          rel_obj = getattr(model, field.name)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1138, in __get__
          return self.get_object_or_id(instance)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 1129, in get_object_or_id
          obj = self.rel_model.get(self.field.to_field == rel_id)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 4300, in get
          return sq.get()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2792, in get
          return clone.execute().next()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2839, in execute
          self._qr = ResultWrapper(model_class, self._execute(), query_meta)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 2535, in _execute
          return self.database.execute_sql(sql, params, self.require_commit)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3339, in execute_sql
          self.commit()
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3185, in __exit__
          reraise(new_type, new_type(*exc_args), traceback)
        File "/home/ubuntu/virtualenvs/venv-2.7.9/lib/python2.7/site-packages/peewee.py", line 3331, in execute_sql
          cursor.execute(sql, params or ())
      OperationalError: no such table: item

@benjaoming benjaoming reopened this Sep 20, 2016

@benjaoming benjaoming modified the milestones: 0.17.0, 0.16.9 Sep 21, 2016

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Dec 17, 2016

Member

A bunch of fixes landed during #5350 and I haven't seen this for a while, so closing.

Member

benjaoming commented Dec 17, 2016

A bunch of fixes landed during #5350 and I haven't seen this for a while, so closing.

@benjaoming benjaoming closed this Dec 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment