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

Can't start the SingleThreadedRunner again after closing it #282

Open
TorecLuik opened this issue Sep 3, 2024 · 0 comments
Open

Can't start the SingleThreadedRunner again after closing it #282

TorecLuik opened this issue Sep 3, 2024 · 0 comments

Comments

@TorecLuik
Copy link

Hey,

I was trying out stopping and starting my (SingleThreadedRunner) runner but it fails.

The little test below raises this RunnerAlreadyStarted exception at the final runner.start() call (so after closing).
I think the close() of SingleThreadedRunner probably should reset that is_started variable?
Or is it not intended to work? at least the error is wrong then.

def test_runner():
    # Create a System instance with the necessary components
    system = System(pipes=[[WorkflowTracker, JobAccounting]])
    runner = SingleThreadedRunner(system)
    runner.start()

    # Get the application
    wft = runner.get(WorkflowTracker)

    # when
    assert wft.closing.is_set() is False
    runner.stop()
    assert wft.closing.is_set() is True
    
    runner.start()
    wft2 = runner.get(WorkflowTracker)
    assert wft2.closing.is_set() is False
    
        if self.is_started:
>           raise RunnerAlreadyStarted()
E           eventsourcing.system.RunnerAlreadyStarted
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

No branches or pull requests

1 participant