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

CancelledJobIsStillAValidExecution is not deterministic #34

Open
linkdotnet opened this issue May 1, 2024 · 2 comments · May be fixed by #85
Open

CancelledJobIsStillAValidExecution is not deterministic #34

linkdotnet opened this issue May 1, 2024 · 2 comments · May be fixed by #85
Assignees
Labels
bug Something isn't working

Comments

@linkdotnet
Copy link
Member

linkdotnet commented May 1, 2024

The following test is flaky and has to be fixed: CancelledJobIsStillAValidExecution.
The problem is that this test seems to fail only when executed with other tests.

EDIT:
The test utilizes a Task.Delay(200) to reduce flakiness. The only way to tackle this properly is to introduce some kind of notification layer so that the test has a chance to know when certain operations are done.

@linkdotnet linkdotnet added the bug Something isn't working label May 1, 2024
@linkdotnet
Copy link
Member Author

I can repeatedly make it fail if I run JobShouldHonorApplicationCancellationDuringRetry first and then CancelledJobIsStillAValidExecution

linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
linkdotnet added a commit that referenced this issue May 2, 2024
@linkdotnet linkdotnet reopened this May 2, 2024
linkdotnet added a commit that referenced this issue May 7, 2024
linkdotnet added a commit that referenced this issue May 7, 2024
commit 4b66e9c6dc0e957f1798bd0bf98d234f7f7321d4
Author: LinkDotNet Bot <linkdotnet@action.com>
Date:   Sun May 5 08:34:20 2024 +0000

    Update Changelog.md for 2.2.1 release

commit 2d0191782833b4c0ac01c1e083cc7387c321daab
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Sat May 4 22:47:07 2024 +0200

    docs: Move from README to Docs

commit 340970553933a73a66e789ac5a7010a8ea6f37b5
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Sat May 4 22:06:51 2024 +0200

    fix: Use write theme

commit 7f1ad596f8541cb0fb01b3cd46ae737a150d18e2
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Sat May 4 21:48:26 2024 +0200

    fix: Include missing workflow

commit 0fd42e0bfe6a8136d26908ca38a1d0eadb5cf77b
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Sat May 4 21:35:10 2024 +0200

    docs: Added documentation

commit d3ae76a53082c90c6d3ad789fb3eb324cd445a9b
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Sat May 4 19:58:58 2024 +0200

    Add PR Template

commit c0a341e7614e71c7d0286a0fe7c4129cf2140dee
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Fri May 3 23:12:40 2024 +0200

    feat: Added RunScheduled with a Delay

commit e8bb2e4ade25e6116cf78db694d61d925f7402e7
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Thu May 2 09:46:09 2024 +0200

    fix: Make test meta-stable

    Fixes #34

commit 02de5cc7528c09abcf6feb378c9f915062a1bf66
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Thu May 2 09:57:23 2024 +0200

    docs: Add Feature request template

commit b09f642c63efbc30e13e2df6014fbc7cfc660717
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed May 1 12:43:40 2024 +0000

    chore(deps): bump thomaseizinger/keep-a-changelog-new-release

    Bumps [thomaseizinger/keep-a-changelog-new-release](https://github.com/thomaseizinger/keep-a-changelog-new-release) from 2.0.0 to 3.0.0.
    - [Release notes](https://github.com/thomaseizinger/keep-a-changelog-new-release/releases)
    - [Changelog](https://github.com/thomaseizinger/keep-a-changelog-new-release/blob/master/CHANGELOG.md)
    - [Commits](thomaseizinger/keep-a-changelog-new-release@2.0.0...3.0.0)

    ---
    updated-dependencies:
    - dependency-name: thomaseizinger/keep-a-changelog-new-release
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

commit 9b44f58b19ce24bcb4ef5d78c6b0bb1a94c68d7f
Author: LinkDotNet Bot <linkdotnet@action.com>
Date:   Wed May 1 11:29:46 2024 +0000

    Update Changelog.md for 2.1.4 release

commit 11c53f434cbf9e539e71b45e66a5babd5bcddd6b
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 30 16:22:01 2024 -0400

    fix: cancellations during retrying (#30)

    * * fixed cancellations during retrying

    * fixed race conditions issue with disposing shutdown CancellationTokenSource before creating a new one.

    * added more tests to validate Retry cancellation

    * fix SonarCube error

    * refactored MockHostApplicationLifetime to save boilerplate code

    * fix analyzer complain

commit 7061bbe
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 30 16:25:27 2024 -0400

    remove old ConcurrencyConfig

commit e7884bf
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 19:36:48 2024 -0400

    corrected the CronExpression

commit 4064c47
Merge: 03ba049 a50ec62
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 19:31:56 2024 -0400

    merg fix-set

commit 03ba049
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 17:02:37 2024 -0400

    fix reason for test failure with EachJobRunHasItsOwnScope

commit a50ec62
Author: Steven Giesel <stgiesel35@gmail.com>
Date:   Mon Apr 29 21:55:41 2024 +0200

    fix: Issue where records are dropped because of set behavior

commit 725c44d
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 03:38:43 2024 -0400

    refactoring for maintainability

commit cb64b62
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 02:44:13 2024 -0400

    fix jobs and remove reliance on Cronos

commit 81ec46f
Merge: 8a5d4a6 4aec8bd
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Mon Apr 29 01:55:31 2024 -0400

    rebase main

commit 8a5d4a6
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Thu Apr 25 19:40:34 2024 -0400

    Updated README.md to reflect the new timezone feature in the job scheduler.

    Modified `LogNextJobRun` method in CronScheduler.cs to use local time instead of UTC.

    Added several tests in JobOptionBuilderTests.cs to verify correct timezone assignment, default behavior, next run time calculation, cross timezone scheduling, and daylight saving time handling.

commit 266397d
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Thu Apr 25 18:34:19 2024 -0400

    fix formatting

commit fd04b63
Merge: 1ab8d46 c520711
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Thu Apr 25 18:31:24 2024 -0400

    fix merge conflicts

commit 1ab8d46
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Wed Apr 17 13:21:54 2024 -0400

    added TimeZone support
    switched NCronTab for Cronos library for native TimeZone support

commit a472301
Merge: b3eccd9 f8eacb2
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 18:26:34 2024 -0400

    merge from origin

commit b3eccd9
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 18:04:45 2024 -0400

    remove commented code

commit f7ba9d4
Merge: db296ad c4485f7
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 18:02:41 2024 -0400

    merge main

commit db296ad
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 17:40:51 2024 -0400

    ensure the Tasks are awaited properly to prevent them from persisting beyond the loop scope

commit c4d0073
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 16:39:10 2024 -0400

    enhanced the concurrency management, cleaned up logs

commit da75ebd
Author: Frank Alvarez <falvarez@wsits.com>
Date:   Tue Apr 16 15:26:11 2024 -0400

    Updated job scheduling and handling in NCronJob

    A new `TestCancellationJob` class has been added to simulate a long-running job and handle job cancellation.
    Everything was made to support async structures to better support error handling and cancellation support.
    Added preliminary parallel execution support.
@falvarez1
Copy link
Member

PR-85 fixes this issue

@falvarez1 falvarez1 linked a pull request Jun 7, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants