Skip to content

No Docker mode fails intermittently on CI #136

@g-elwell

Description

@g-elwell

Describe the bug
When using the No Docker mode introduced in #109 CI can sometimes fail during the soft-reset which appears to be related to the database import not completing successfully.

I've tried several approaches to attempt to resolve this, the most promising is to run wp db reset prior to attempting to import a database during the soft-reset. However, CI still fails intermittently even when this is the case.

This issue does not affect running WP Cypress locally or in Docker on CI, it's limited to the No Docker mode which is likely not being widely used outside of Big Bite at the moment.

To Reproduce
Steps to reproduce the behavior:

  1. Follow steps outlined in Add No Docker Mode #109 to configure No Docker mode on a project
  2. Run the CI process
  3. If successful, re-trigger the process
  4. You should see intermittent failures

Expected behavior
No Docker mode should have consistent results when running on CI

Additional context
Contents of WP Cypress debug.log:

[2024-07-03T15:42:50.925Z] stdout: 6.5.4
 
[2024-07-03T15:42:51.752Z] stdout: Success: Current User set to admin
 
[2024-07-03T15:42:52.514Z] stdout: Success: Database reset.
 
[2024-07-03T15:42:53.178Z] stderr: ERROR 1062 (23000) at line 211 in file: '/tmp/db.sql': Duplicate entry '0' for key 'wp_options.PRIMARY'
 
[2024-07-03T15:42:53.249Z] stderr: ERROR 1062 (23000) at line 425 in file: '/tmp/db.sql': Duplicate entry '0' for key 'wp_posts.PRIMARY'
 
[2024-07-03T15:42:53.407Z] stderr: ERROR 1062 (23000) at line 714 in file: '/tmp/db.sql': Duplicate entry '0' for key 'wp_usermeta.PRIMARY'
 
[2024-07-03T15:42:53.420Z] stderr: ERROR 1062 (23000) at line 829 in file: '/tmp/db.sql': Duplicate entry '0' for key 'wp_users.PRIMARY'
 
[2024-07-03T15:42:53.425Z] stdout: Success: Imported from '/tmp/db.sql'.
 
[2024-07-03T15:42:53.805Z] stderr: Error: One or more database tables are unavailable. The database may need to be repaired.
 
[2024-07-03T15:42:53.811Z] Exited with code 1 

The tmp/db.sql file can be uploaded to CircleCI as an artifact by adding the following to .circleci/config.yml:

  - store_artifacts:
      when: always
      path: /tmp/db.sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions