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

Use devstats.PID.json as devstate #6713

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Apr 4, 2023

What type of PR is this:

/kind feature

What does this PR do / why we need it:

State of odo dev if now saved in a file .odo/devstate.${PID}.json, to be able to run multiple instances and state for each of them.

For compatibility, the file .odo/devstate.json is also used for the first instance of odo dev.

One drawback is that if an instance of odo dev is killed, the devstate.json file won't be overwritten. One possibility would be to delete it when running odo delete component and the process with registered PID into devstate.json is not existing.

Which issue(s) this PR fixes:

Fixes #6494

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Apr 4, 2023
@netlify
Copy link

netlify bot commented Apr 4, 2023

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 0877169
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/643ea97eca09220008413403

@openshift-ci openshift-ci bot requested review from rm3l and valaparthvi April 4, 2023 08:18
@feloy feloy changed the title Use devstats.PID.json as devstate [WIP] Use devstats.PID.json as devstate Apr 4, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Apr 4, 2023
@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

NoCluster Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

OpenShift Unauthenticated Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

Unit Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

Validate Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

Windows Tests (OCP) on commit 18d94d6 finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

OpenShift Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

Kubernetes Tests on commit 18d94d6 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Apr 4, 2023

Kubernetes Docs Tests on commit 0dc2f4d finished successfully.
View logs: TXT HTML

@feloy feloy force-pushed the feature-6494/multiple-dev-sessions branch 7 times, most recently from af7ea5f to 0008627 Compare April 6, 2023 08:44
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 7, 2023
@feloy feloy changed the title [WIP] Use devstats.PID.json as devstate Use devstats.PID.json as devstate Apr 11, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Apr 11, 2023
@feloy feloy force-pushed the feature-6494/multiple-dev-sessions branch from e9f8d68 to 2dc707b Compare April 11, 2023 10:13
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 11, 2023
pkg/state/state.go Outdated Show resolved Hide resolved
pkg/state/state.go Outdated Show resolved Hide resolved
pkg/odo/cli/dev/dev.go Outdated Show resolved Hide resolved
pkg/state/errors.go Show resolved Hide resolved
pkg/state/state.go Outdated Show resolved Hide resolved
pkg/state/state.go Outdated Show resolved Hide resolved
pkg/state/process_unix.go Show resolved Hide resolved
@feloy
Copy link
Contributor Author

feloy commented Apr 13, 2023

Thanks @rm3l for your review

@feloy feloy requested a review from rm3l April 13, 2023 08:35
@feloy feloy reopened this Apr 17, 2023
@feloy
Copy link
Contributor Author

feloy commented Apr 17, 2023

Investigating this error:

On Windows, it seems that the second process detects correctly that a first process exists.
But at the time of stopping the first process at the end of the test, an error occurs.

WaitForDevModeToContain fails when the process terminates.

[FAILED] [66.184 seconds]
odo dev command tests when a component with multiple endpoints is run [It] should fail running a second session on the same platform
C:/Users/Administrator.ANSIBLE-TEST-VS/3707/tests/integration/cmd_dev_test.go:3081

[...]

 [odo]   __
  [odo]  /  \__     Developing using the "ijoreq" Devfile
  [odo]  \__/  \    Namespace: cmd-dev-test3081fac
  [odo]  /  \__/    odo version: v3.9.0
  [odo]  \__/
  [odo] 
  [odo] - Running on the cluster in Dev mode
  [odo]  X  unable to save state file: a session with PID 11436 is already running on platform "cluster"

[...]

[FAILED] Unexpected error:
      <*fmt.wrapError | 0xc001fd6260>: {
          msg: "calling GenerateConsoleCtrlEvent: The parameter is incorrect.",
          err: <syscall.Errno>0x57,
      }
      calling GenerateConsoleCtrlEvent: The parameter is incorrect.
  occurred
  In [It] at: C:/Users/Administrator.ANSIBLE-TEST-VS/3707/tests/helper/helper_dev.go:195 @ 04/17/23 03:58:31.703

@feloy feloy force-pushed the feature-6494/multiple-dev-sessions branch from 202db74 to 218b982 Compare April 17, 2023 11:32
@feloy feloy removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Apr 17, 2023
@feloy feloy requested a review from rm3l April 17, 2023 12:11
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great - thanks!

@rm3l
Copy link
Member

rm3l commented Apr 18, 2023

@feloy Can you rebase your branch onto main? I was about to re-lgtm this PR, but noticed it has a conflict.

@feloy feloy force-pushed the feature-6494/multiple-dev-sessions branch from 218b982 to 0877169 Compare April 18, 2023 14:35
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 18, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 18, 2023
@feloy feloy closed this Apr 19, 2023
@feloy feloy reopened this Apr 19, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@feloy
Copy link
Contributor Author

feloy commented Apr 19, 2023

/override windows-integration-test/Windows-test
Flaky tests

@openshift-ci
Copy link

openshift-ci bot commented Apr 19, 2023

@feloy: Overrode contexts on behalf of feloy: windows-integration-test/Windows-test

In response to this:

/override windows-integration-test/Windows-test
Flaky tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit bd5098e into redhat-developer:main Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo dev on podman and cluster cannot run simultaneously
3 participants