Skip to content
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

update startingEntitiesCount at beginning of create e2e test #13825

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

ruddell
Copy link
Member

@ruddell ruddell commented Feb 3, 2021

The startingEntitiesCount is set in the before method at the beginning of the entity E2E test. If the "create entity" test fails after creating an entity, it will retry that specific test. But the before method does not run again (docs), leading to a stale startingEntitiesCount value.

You can see an example of the issue in the CI logs here. You can validate the issue is happening by checking the screenshots uploaded in the artifacts after that CI run (uploaded here for reference: attempt 1, attempt2, attempt3). I'm not sure why the first attempt failed, but the second and third attempts should be fixed by this PR.


Please make sure the below checklist is followed for Pull Requests.

The `startingEntitiesCount` is set in the `before` method the beginning of the entity E2E test.  If the "create entity" test fails after creating an entity, it will retry that specific test.  But the `before` method does not run again, leading to a stale `startingEntitiesCount` value.
@mshima
Copy link
Member

mshima commented Feb 3, 2021

This should fix the flakiness.
'startingEntitiesCount' should not be at describe scope, it should be a local variable for each test.
This breaks https://docs.cypress.io/guides/references/best-practices.html#Having-tests-rely-on-the-state-of-previous-tests.

Good catch.

Copy link
Member

@mshima mshima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is required.

@mshima mshima merged commit c2b2482 into jhipster:main Feb 4, 2021
@ruddell ruddell deleted the fix-retry-on-create branch February 4, 2021 14:01
@mshima mshima mentioned this pull request Feb 5, 2021
1 task
@pascalgrimaud pascalgrimaud added this to the v7.0.0-beta.2 milestone Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants