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

mcobbett exit immediately when all tests done #298

Merged
merged 7 commits into from
Oct 24, 2024

Conversation

techcobweb
Copy link
Contributor

@techcobweb techcobweb commented Oct 24, 2024

Why ?

While investigating galasa-dev/projectmanagement#2009 I noted that the CLI tool didn't exit the moment the last test completed.
It used to but at some point it stopped doing that.

It turns out that 2 timer services were being created. One thread went to sleep on one, and the other thread woke up on the other. So the interrupt event never woke the sleeping thread.

Solution: Use a single sleep service, and separate the sleeper service from the time service so it's less likely in the future.

Also, using the golang select... and time.After(delay) is the recommended way of doing this stuff as of Golang 1.23. What I've coded does work, but prior to 1.23 may result in a timer resource leakage.

We need to uplift the golang requirement to 1.23 next to avoid any resource leakage.

  • Use timer service to wake up outer loop
  • run status was never being reported properly for local runs. Only result was being copied over into the reported structure.
  • Separated out the time service from the sleeper service.

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
…ult was being copied over into the reported structure.

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build failed, see http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/galasa-build/pipelineruns/repo-cli-pr-298-x7c6n for details. If you are unable to do so, please contact a member of the Galasa team.

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build failed, see http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/galasa-build/pipelineruns/repo-cli-pr-298-89bs2 for details. If you are unable to do so, please contact a member of the Galasa team.

test-scripts/run-single-test-remotely.sh Outdated Show resolved Hide resolved
pkg/utils/timeService.go Outdated Show resolved Hide resolved
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build failed, see http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/galasa-build/pipelineruns/repo-cli-pr-298-gbl7m for details. If you are unable to do so, please contact a member of the Galasa team.

@galasa-team
Copy link

Build successful

1 similar comment
@galasa-team
Copy link

Build successful

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

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.

3 participants