-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-32954 Add unit tests for the jobqueue #19298
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32954 Jirabot Action Result: |
@ghalliday How long this new unit test suppose to be running? |
@ghalliday I have a core trace, but it seems odd:
Unfortunately there is not Thread 0 stack trace. |
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.
@ghalliday - some trivial comments + 1 re. expectedResults check being commented out
common/workunit/wujobq.cpp
Outdated
{ | ||
unsigned timeout = prioritytransitiondelay; | ||
bool usePrevPrio = true; | ||
item.setown(dodequeue(minPrio, timeout, usePrevPrio, nullptr)); |
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.
trivial: not sure overloading 'timeout' here (2 lines above) vs using 'prioritytransitiondelay' directly makes the code more intuitive.
testing/unittests/dalitests.cpp
Outdated
|
||
|
||
static constexpr bool traceJobQueue = false; | ||
static unsigned jobQueueStartTick; |
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.
in practice it may not matter in practice, but would look better if initialized to 0?
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.
statics are initialised, but added an explicit initialiser.
testing/unittests/dalitests.cpp
Outdated
{ | ||
return (msTick() - jobQueueStartTick) / tickScaling; | ||
} | ||
static void JobQueueSleep(unsigned ms) |
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.
pedantic: unusual for methods not to be camel case?
testing/unittests/dalitests.cpp
Outdated
JobProcessor & cur = jobProcessors.item(i3); | ||
DBGLOG(" Result: '%s' '%s'", cur.queryOutput(), cur.queryLog()); | ||
// if (i3 < expectedResults.size()) | ||
// CPPUNIT_ASSERT_EQUAL(std::string(expectedResults.begin()[i3]), std::string(cur.queryOutput())); |
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.
accidentally left commented out?
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.
Commented out because it needed improving - now implemented.
Signed-off-by: Gavin Halliday <[email protected]>
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.
@ghalliday - I didn't spot any issues. 1 trivial formatting comment.
testing/unittests/dalitests.cpp
Outdated
JobProcessor(Semaphore & _startedSem, Semaphore & _processedSem, IJobQueue * _queue, unsigned _id) | ||
: startedSem(_startedSem), processedSem(_processedSem), queue(_queue), id(_id) | ||
{ | ||
} |
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.
trivial/formatting: arguably odd indentation (braces not under ctor name)
unit test regression test is timing out - I will investigate why. |
Signed-off-by: Gavin Halliday <[email protected]>
Fixed indent and renamed test so that not run as part of normal unit tests |
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32954 Jirabot Action Result: |
Jirabot Action Result: |
Type of change:
Checklist:
Smoketest:
Testing: