Skip to content

Conversation

@stevebio
Copy link
Collaborator

…and only once. Set reasonable timeouts for some of the bulk operations and remove infinite timeouts which can hang the test.

Copilot AI review requested due to automatic review settings October 14, 2025 00:03
@stevebio stevebio requested a review from rjrudin as a code owner October 14, 2025 00:03
@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Copyright Validation Results
Total: 12 | Passed: 11 | Failed: 0 | Skipped: 1 | at: 2025-10-15 00:34:58 UTC | commit: 6fb52f3

⏭️ Skipped (Excluded) Files

  • test-basic/digestauth-fips-nomd5load.js

✅ Valid Files

  • test-basic/annTopK.js
  • test-basic/basePath-test.js
  • test-basic/bindingFromParam.js
  • test-basic/client.js
  • test-basic/cloud_authentication-test.js
  • test-basic/docColTypes-test.js
  • test-basic/documents-core.js
  • test-basic/documents-data-movement-queryAll.js
  • test-basic/documents-data-movement-readAll.js
  • test-basic/endpoint-caller.js
  • test-basic/service-caller.js

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses test stability issues by ensuring the done() method is called exactly once in each test and implementing reasonable timeouts for bulk operations. The changes focus on preventing tests from hanging by removing infinite timeouts and adding proper error handling.

  • Replaces infinite timeouts (this.timeout(0)) with reasonable 30-second and 120-second timeouts
  • Adds proper error handling with try-catch blocks to ensure done() is called once
  • Ensures tests that expect errors call done() with appropriate error messages when exceptions don't occur

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-basic/service-caller.js Adds 30-second timeout for test setup
test-basic/endpoint-caller.js Adds 30-second timeout for test setup
test-basic/documents-data-movement-readAll.js Replaces infinite timeout with 120-second timeout and updates comments
test-basic/documents-data-movement-queryAll.js Replaces infinite timeout with 120-second timeout and updates comments
test-basic/documents-core.js Adds try-catch blocks around assertions to ensure proper error handling
test-basic/docColTypes-test.js Ensures error is thrown when invalid document descriptor is used
test-basic/digestauth-fips-nomd5load.js Adds missing done parameter and proper error handling
test-basic/cloud_authentication-test.js Ensures error is thrown when apiKey is missing
test-basic/client.js Adds try-catch blocks and ensures errors are thrown for invalid configurations
test-basic/bindingFromParam.js Adds proper error handling and ensures expected errors are thrown
test-basic/basePath-test.js Ensures errors are thrown for invalid basePath configurations
test-basic/annTopK.js Ensures error is thrown for invalid options argument

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@rjrudin rjrudin left a comment

Choose a reason for hiding this comment

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

Looks good, just adding comments I got from Copilot locally.

…and only once. Set reasonable timeouts for some of the bulk operations and remove infinite timeouts which can hang the test.
@stevebio stevebio force-pushed the task/ensureDoneCalledForTests branch from 02ff571 to d9a236a Compare October 14, 2025 17:50
@rjrudin rjrudin self-requested a review October 14, 2025 18:08
anu3990
anu3990 previously approved these changes Oct 14, 2025
stevebio and others added 2 commits October 14, 2025 17:23
…ations. Change annTopK tests to use await/rejects idiom which is easier to understand. Skip the cloud test that tries to connect to support.beta.marklogic.cloud. That DNS name is not resolving as of today.
Copy link
Contributor

@rjrudin rjrudin left a comment

Choose a reason for hiding this comment

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

I just forced the pipeline to run again to see if we get a green build. I'm sure the 4 failures aren't related to this because they're all "test-complete" tests. But those failures also show at least one test where "done is called multiple times", thus masking the real failure.

@stevebio stevebio merged commit d6d1ba8 into marklogic:develop Oct 15, 2025
3 checks passed
@stevebio stevebio deleted the task/ensureDoneCalledForTests branch October 15, 2025 14:53
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.

3 participants