-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Adjust server-side timers when resuming an execution #2438
feat: Adjust server-side timers when resuming an execution #2438
Conversation
…test session as a whole
e225c2e
to
8da35ae
Compare
Front-end summary Node 18
|
$timestamp = $timer->getLastTimestamp( | ||
$testSession->getItemTags($item) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Optional]
$timestamp = $timer->getLastTimestamp( | |
$testSession->getItemTags($item) | |
); | |
$timestamp = $timer->getLastTimestamp($testSession->getItemTags($item)); |
$sources = [ | ||
$routeItem->getAssessmentTest(), | ||
$this->getAssessmentTest(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure, that we can use $this
(TestSession) instead of RoutItem ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves a bug: If this ends up being called on a test (lets call it test B) other than the one we are current running (lets call it test A), $routeItem
is null
. That is, getCurrentRouteItem()
returns null
when called from a request associated with the test runner session for test A to get the current item for test B.
protected function getCurrentRouteItem()
{
if ($this->isRunning() === true) {
return $this->getRoute()->current();
}
return false;
}
The test we are pausing (B) is / was running, but not in the current request (which is "bound" to A), and we need this to work also in that case (so the elapsed time for the item of test B is stored when suspending the test).
Both $routeItem->getAssessmentItemRef()
and $this->getAssessmentTest()
return an instance of AssessmentTest
that refers to the same test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested the feature and it looks to work well. Additional checks would be needed at QA side to validate that all is working seamlessly without impacting the other places.
I only have one concern regarding the added logs, which are great but too verbose IMO. I'd rather advise reducing this by moving them to a lower level (trace or debug).
Review Checklist
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code respects code style rules
- New code respects best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
- Pull request's target is not
master
- Commits are following conventional commits
- Commits messages are meaningful
- Commits are atomic
Co-authored-by: Andrei Shapiro <[email protected]> Signed-off-by: Héctor Arroyo <[email protected]>
Version
There are 0 BREAKING CHANGE, 1 feature, 5 fixes |
These changes passed QA, therefore I'm merging this PR. |
Released as v48.3.0. |
* feat: Adjust server timers when resuming an execution * chore: Get the former order for duration cache updates * fix: Explicitly provide the component to apply the adjustment in * chore: Revert to the simpler approach applying the adjustment tot he test session as a whole * fix: Store the pause timestamp associated to all execution IDs * chore: Coding style improvements * chore: Use a lower log level for debug messages in ConcurringSessionService * fix: Don't try to update the duration cache for non-available sources * fix: Pass the execution user ID when fetching the service context * fix: Store the item duration instead of the current timestamp on test suspension * test: Update unit tests --------- Signed-off-by: Héctor Arroyo <[email protected]> Co-authored-by: Andrei Shapiro <[email protected]>
Associated Jira issue: TR-5911
Changelog:
ConcurringSessionService
to store the timestamp when a test is suspended because another one has been launched.getCurrentRouteItem()
may benull