Skip to content

Comparing files via cy.readFile() results in endlessloop #25443

@DiereggerF

Description

@DiereggerF

Current behavior

When I am using the follwing code below and use two matching assets (.tiff or .jpeg) it works fine (low runtime & tests run green), but if I am using files that do not match (e.g two different .jpeg files) my test runner (open and run mode) seems to be stuck in some kind of endless loop, (longest run before i aborted was 1.5hours).
No loggin is performed during this runtime neither in open nor run mode.

Desired behavior

Value compare should work for not matching assets without problems and in the near the same time as the happy path.

Test code to reproduce

it('tests some asset', () => {
  const someasset = 'test1.tif'
  const assetNameDownload = 'test2.tif'
  cy.readFile(`cypress/fixtures/assets/downloadCompare/${someasset}`, 'base64').then((original) => {
    cy.readFile(`cypress/downloads/${assetNameDownload}`, 'base64').should('eq', original)
  });
})

Cypress Version

12.3.0

Node version

v16.15.0

Operating System

Windows 10.0.22621, Ubuntu 20.04.5 LTS

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    prevent-stalemark an issue so it is ignored by stale[bot]type: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions