Skip to content

Comments

Fix workspace intermittent test#714

Merged
dulajdilshan merged 1 commit intoballerina-platform:mainfrom
dulajdilshan:fix-test-failures
Feb 18, 2026
Merged

Fix workspace intermittent test#714
dulajdilshan merged 1 commit intoballerina-platform:mainfrom
dulajdilshan:fix-test-failures

Conversation

@dulajdilshan
Copy link
Contributor

@dulajdilshan dulajdilshan commented Feb 18, 2026

Purpose

$title

Summary

This pull request addresses intermittent test failures by removing imported module dependencies from the workspace test configuration and source files.

The changes systematically remove:

  • Import statements for ballerina/io and ballerina/time modules from test source files
  • Corresponding function and type entries from the Standard Library and Imported Types sections in test configuration JSON files
  • Code that depends on the removed modules, with refactored logic to maintain test coverage without external dependencies

Specifically:

  • Test source files (main.bal, timeutils.bal): Removed module imports and refactored function implementations to eliminate external dependencies
  • Test configuration files (workspace_pkg1_default.json, workspace_pkg2_default.json): Cleaned up function and type catalogs by removing entries related to the eliminated imports

These changes improve test reliability by reducing external dependencies that could introduce timing issues or intermittent behavior, thereby stabilizing the workspace configuration test suite.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Test resource files for a flow model generator extension are updated: function and type search configuration files are modified to remove imported types and restructure io/time function listings, while corresponding source test files are refactored to remove io and time imports and simplify logic implementation.

Changes

Cohort / File(s) Summary
Type Search Configuration
src/test/resources/search/config/types/workspace_pkg1_default.json, src/test/resources/search/config/types/workspace_pkg2_default.json
Removes all imported type entries (Block, ReadableByteChannel, WritableByteChannel, Format, Error variants, etc.) from imported types arrays, replacing with empty items lists.
Function Search Configuration
src/test/resources/search/config/functions/workspace_pkg1_default.json
Removes io package function entries (file read/write operations) from standard library io section; reintroduces time subgroup with utcFromString and utcNow functions; adds empty imported functions section.
Test Source Code
src/test/resources/search/source/workspace1/package1/main.bal, src/test/resources/search/source/workspace1/package1/timeutils.bal, src/test/resources/search/source/workspace1/package2/main.bal
Removes ballerina/io and ballerina/time imports; refactors main.bal files to replace print statements with local computation and storage; changes getCurrentTimestamp() return type from time:Utc to int with constant return value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • KavinduZoysa
  • pasindufernando1

Poem

🐰 A rabbit hops through test configs bright,
Pruning io functions left and right,
Time and types are reorganized with glee,
Imports vanish, code grows lean and free! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is severely incomplete, containing only the purpose section with minimal content ('$title' repeated), missing all other required template sections. Fill out the complete PR description template with Goals, Approach, User stories, Release note, Documentation, and other relevant sections to provide proper context and rationale for the changes.
Title check ❓ Inconclusive The title 'Fix workspace intermittent test' is vague and doesn't clearly convey what specific intermittent test issue is being fixed or what the actual changes address. Make the title more specific by indicating what aspect of the workspace test is being fixed, e.g., 'Fix workspace search test by removing imported modules' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@dulajdilshan dulajdilshan merged commit 698c46f into ballerina-platform:main Feb 18, 2026
4 checks passed
@dulajdilshan dulajdilshan deleted the fix-test-failures branch February 18, 2026 02:47
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.

2 participants