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

#169 added parameter for debug wait timeout. #185

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

peetkes
Copy link
Contributor

@peetkes peetkes commented Aug 11, 2023

Can be set in gradle properties by specifying a value for mlDebugWaitTimeout

Can be set in gradle properties by specifying a value for mlDebugWaitTimeout
@@ -71,8 +73,8 @@ declare private function cover:_task-cancel-safe(
for $breakpoint in dbg:breakpoints($id)
return dbg:clear($id, $breakpoint),
dbg:detach($id),
if (fn:empty(dbg:wait($id, 10))) then
fn:error(xs:QName("FAILED-TO-CANCEL"), "unable to cancel a debugging request")
if (fn:empty(dbg:wait($id, if ($TIMEOUT eq "%%mlDebugWaitTimeout%%") then $DEFAULT_TIMEOUT else $TIMEOUT)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that this reference will be replaced as well, so it will resolve to e.g. "if ($TIMEOUT eq 8)", and it will in fact equal 8 - which means DEFAULT_TIMEOUT will be used instead.

I think you want to do an fn:contains here on "mlDebugWaitTimeout".

I'm still hesitant though about having this rely on a feature of ml-gradle. How about if this depends on a server field instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm leaning towards a server field here. In my experience, unit tests typically run against a single-node cluster, so the issue of a server field being set on one host but not another won't matter. In a 3+ node cluster, it's still simple enough to have all requests go to the same host.

Copy link
Member

Choose a reason for hiding this comment

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

Expecting a single node to be used and NOT a load balancer feels brittle.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair. How about if we do %%marklogicUnitTestDebugTimeout%%? That makes it clear it's specific to marklogic-unit-test (wish that itself had a much shorter, snappier name).

Copy link
Contributor

Choose a reason for hiding this comment

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

@peetkes Just a note, I'm happy to merge this with the above changes.

@jamesagardner
Copy link
Contributor

jamesagardner commented Sep 6, 2023 via email

@jamesagardner
Copy link
Contributor

jamesagardner commented Sep 6, 2023 via email

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.

None yet

4 participants