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

Add the test for checking inactive workspace #9171

Merged
merged 12 commits into from
Mar 28, 2018
Merged

Add the test for checking inactive workspace #9171

merged 12 commits into from
Mar 28, 2018

Conversation

musienko-maxim
Copy link
Contributor

@musienko-maxim musienko-maxim commented Mar 21, 2018

What does this PR do?

  • In CHE 6 has been added functionality for checking activity workspaces. If a user does not produce actions in the Che workspace this one will be stopped according to settings for activity checker.
  • The test create and launch the test workspace and do delay without any activity, than check that the workspace has been stopped.
    @artaleks9, @dmytro-ndp, @SkorikSergey, @Ohrimenko1988. @vparfonov

What issues does this PR fix or reference?

#9166

@dmytro-ndp
Copy link
Contributor

Looks like the this PR is about Add the test to check stopping inactive workspace.

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Mar 21, 2018
@musienko-maxim musienko-maxim changed the title Add the test for checking activity workspaces Add the test for checking inactive workspace Mar 21, 2018
@musienko-maxim
Copy link
Contributor Author

ci-build

+ TOASTLOADER_WIDGET_LATECY_TIMEOUT_IN_MILLISEC;
ide.open(testWorkspace);
projectExplorer.waitProjectExplorer();
WaitUtils.sleepQuietly(commonTimeout, TimeUnit.MILLISECONDS);
Copy link
Contributor

@dmytro-ndp dmytro-ndp Mar 21, 2018

Choose a reason for hiding this comment

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

Please, explain why we need to sleep here, in comment.

package org.eclipse.che.selenium.workspaces;

import static org.testng.AssertJUnit.assertEquals;

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it exactly what you want to add? Maybe "org.testng.Assert"?

@@ -14,6 +14,8 @@ tests.screenshots_dir=target/screenshots
tests.htmldumps_dir=target/htmldumps
tests.workspacelogs_dir=target/workspace-logs
tests.webdriverlogs_dir=target/webdriver-logs
che.workspace_agent_dev_inactive_stop_timeout_ms=300000
active.state_activity_sheduler_period=60000
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please rephrase the name of property so that it complies naming convention and describes the proposal clearer?


public class CheckStoppingWsByTimeoutTest {

private static int TOASTLOADER_WIDGET_LATECY_TIMEOUT_IN_MILLISEC = 20000;
Copy link
Contributor

Choose a reason for hiding this comment

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

LATECY - what does this mean?


@Inject
@Named("che.workspace_agent_dev_inactive_stop_timeout_ms")
private int stoppingTimeotInaciveWorkspace;
Copy link
Contributor

Choose a reason for hiding this comment

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

Timeot - what does this mean?

int commonTimeout =
stoppingTimeotInaciveWorkspace
+ shedulerRequstTimeout
+ TOASTLOADER_WIDGET_LATECY_TIMEOUT_IN_MILLISEC;
Copy link
Contributor

@Ohrimenko1988 Ohrimenko1988 Mar 21, 2018

Choose a reason for hiding this comment

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

What about encapsulate

int commonTimeout =
        stoppingTimeotInaciveWorkspace
             shedulerRequstTimeout
                 TOASTLOADER_WIDGET_LATECY_TIMEOUT_IN_MILLISEC;

to the private method, something like "getCommonTimeout()"? This is not necessarily, but in my opinion, it will be more clean:

public void setUp() throws Exception {
  ide.open(testWorkspace);
  projectExplorer.waitProjectExplorer();
  WaitUtils.sleepQuietly(getCommonTimeout(), TimeUnit.MILLISECONDS);
}

Copy link
Contributor

@Ohrimenko1988 Ohrimenko1988 Mar 21, 2018

Choose a reason for hiding this comment

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

And one more remark, typos: "stoppingTimeotInaciveWorkspace" -> "stoppingTimeoutInactiveWorkspace"

@Inject
@Named("active.state_activity_sheduler_period")
int shedulerRequstTimeout;

Copy link
Contributor

Choose a reason for hiding this comment

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

"Request"

Workspace workspace =
workspaceServiceClient.getByName(
testWorkspace.getName(), testUser.getName(), testUser.getAuthToken());
assertEquals(workspace.getStatus(), WorkspaceStatus.STOPPED);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you, please, explain why we are expecting STOPPED status of workspace here?

@codenvy-ci
Copy link

private int getCommonTimeout() {
return cheWorkspaceAgentDevInactiveStopTimeoutMilliseconds
+ TOASTLOADER_WIDGET_LATENCY_TIMEOUT_IN_MILLISEC
+ cheWorkspaceActivityCheckSchedulerPeriodInSeconds * 1000;
Copy link
Contributor

@dmytro-ndp dmytro-ndp Mar 22, 2018

Choose a reason for hiding this comment

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

It's better to point millisecond unit of time measurement in the method name: getCommonTimeoutInMillisec

@musienko-maxim
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9171
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@musienko-maxim
Copy link
Contributor Author

ci-test-docker-multi

@riuvshin
Copy link
Contributor

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9171
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@musienko-maxim musienko-maxim merged commit 8697a5e into master Mar 28, 2018
@musienko-maxim musienko-maxim deleted the CHE-9166 branch March 28, 2018 21:49
@musienko-maxim musienko-maxim restored the CHE-9166 branch March 29, 2018 06:08
musienko-maxim pushed a commit that referenced this pull request Mar 29, 2018
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Mar 29, 2018
@benoitf benoitf added this to the 6.4.0 milestone Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants