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

Fixed flaky test-case: ZeroCodeAssertionsProcessorImplTest#testDate.testDateAfterBefore_fail_both #691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hermya
Copy link
Contributor

@hermya hermya commented Oct 22, 2024

Fixed flaky test-case

Fixes Issue

PR Branch
fork

Motivation and Context

ZeroCodeAssertionsProcessorImplTest#testDate.testDateAfterBefore_fail_both is a flaky test, fixed in this PR.

POINT OF FAILURE ->

In ZeroCodeAssertionsProcessorImpl.createJsonAsserters, ObjectMapper.mapTree creates a JsonNode object whose key-value pairs are not necessarily ordered, thus the elements in List<JsonAsserter> are not ordered, causing further failures.
Fixed using NonDex pugin

For particular test:
Add the following lines to your pom.xml

  <plugin> <!-- for flaky testing -->
      <groupId>edu.illinois</groupId>
      <artifactId>nondex-maven-plugin</artifactId>
      <version>2.1.7</version>
  </plugin>

and run

mvn -pl ./core nondex:nondex -Dtest=org.jsmart.zerocode.core.engine.preprocessor.ZeroCodeAssertionsProcessorImplTest#testDateAfterBefore_fail_both -DnondexRuns=10 -DnondexMode=ONE

OR

mvn -pl ./core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.jsmart.zerocode.core.engine.preprocessor.ZeroCodeAssertionsProcessorImplTest#testDateAfterBefore_fail_both -DnondexRuns=10 -DnondexMode=ONE

For more information : https://github.com/TestingResearchIllinois/NonDex

Checklist:

  • New Unit tests were added

    • Covered in existing Unit tests
  • Integration tests were added

    • Covered in existing Integration tests
  • Test names are meaningful

  • Feature manually tested and outcome is successful

  • PR doesn't break any of the earlier features for end users

    • WARNING! This might break one or more earlier earlier features, hence left a comment tagging all reviewrs
  • Branch build passed in CI

  • No 'package.*' in the imports

  • Relevant DOcumentation page added or updated with clear instructions and examples for the end user

    • Not applicable. This was only a code refactor change, no functional or behaviourial changes were introduced
  • Http test added to http-testing module(if applicable) ?

    • Not applicable. The changes did not affect HTTP automation flow
  • Kafka test added to kafka-testing module(if applicable) ?

    • Not applicable. The changes did not affect Kafka automation flow

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.

1 participant