RealDevSquad / RealDevSquad/website-backend

BugFix: Fix the flaky test case

Open
#2,247 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

Issue Description
1 failing
  1) Tasks
       PATCH /tasks
         Should add startedOn field when assignee passed as a payload:
      AssertionError: expected 1731347350 to equal 1731347351
      + expected - actual
      -1731347350
      +1731347351
      
      at Context.<anonymous> (test/integration/tasks.test.js:769:50)
      at Generator.next (<anonymous>)
      at fulfilled (test/integration/tasks.test.js:4:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

This test case fails randomly, and passes on re-running it

Expected Behavior
  • The test case shouldn't fail any time. We should fix the logic of this test case, as due to this flaky test, people can sometime ignore the genuinely failing test cases too.
Current Behavior
Screenshots
Reproducibility
  • This issue is reproducible
  • This issue is not reproducible
Steps to Reproduce
Severity/Priority
  • Critical
  • High
  • Medium
  • Low
Additional Information
Checklist
  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/integration/tasks.test.js at line 769 and run the PATCH /tasks integration test for the startedOn assertion. Inspect how the expected and actual timestamps are produced, then verify the test passes reliably across repeated runs without masking genuine failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.