Skip to content

Conversation

@OSA413
Copy link
Collaborator

@OSA413 OSA413 commented Nov 23, 2025

User description

Description of change

This change adds sleep 10 command that adds an extra wait for the containers to be up and running for Oracle DB. Currently Oracle tests (tests-linux (20) / oracle specifically) sometimes/mostly fail on master branch and PR branches, this should mitigate the problem.

I've re-run the tests-linux (20) / oracle about 5 times on my fork and it looks the issue is gone.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • [ ] This pull request links relevant issues as Fixes #00000
  • [ ] There are new or updated unit tests validating the change
  • [ ] Documentation has been updated to reflect this change

PR Type

Bug fix


Description

  • Add 10-second delay after Oracle container startup

  • Mitigates flaky Oracle test failures on Node 20

  • Ensures container is fully ready before tests run


Diagram Walkthrough

flowchart LR
  A["Docker Compose Up"] --> B["Sleep 10 seconds"]
  B --> C["Run Tests"]
Loading

File Walkthrough

Relevant files
Bug fix
tests-linux.yml
Add sleep delay after Oracle container startup                     

.github/workflows/tests-linux.yml

  • Added sleep 10 command after Oracle container startup
  • Provides additional wait time for container initialization
  • Addresses intermittent test failures in Oracle test suite
+1/-0     

@qodo-free-for-open-source-projects
Copy link

qodo-free-for-open-source-projects bot commented Nov 23, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link

qodo-free-for-open-source-projects bot commented Nov 23, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Replace fixed sleep with robust polling

Replace the fixed sleep with a more robust polling script. The script should
check the Oracle container's logs for a readiness message, making the test
workflow more resilient to variations in startup time.

.github/workflows/tests-linux.yml [303]

-- run: sleep 10
+- run: |
+    echo "Waiting for Oracle database to be ready..."
+    if ! timeout 180s bash -c '
+      until docker logs $(docker compose ps -q oracle) 2>&1 | grep -q "DATABASE IS READY TO USE!"; do
+        echo "Waiting for Oracle..."
+        sleep 5
+      done
+    '; then
+      echo "Oracle database did not become ready in time."
+      docker logs $(docker compose ps -q oracle)
+      exit 1
+    fi
+    echo "Oracle is ready!"
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly points out that a fixed sleep is a brittle solution for service readiness and can cause flaky tests. Proposing a robust polling mechanism significantly improves the reliability and efficiency of the CI workflow.

Medium
  • Update

@coveralls
Copy link

coveralls commented Nov 23, 2025

Coverage Status

coverage: 80.769%. first build
when pulling f153057 on OSA413:check-oracle-fail
into ade198c on typeorm:master.

- run: npm ci
- run: cat ormconfig.sample.json | jq 'map(select(.name == "oracle"))' > ormconfig.json
- run: docker compose up oracle --no-recreate --wait
- run: sleep 10
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be a bit too much, the user setup script shouldn't require this much time. Will try to check long it takes if possible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Startup is quite fast for me, so is executing the user setup script. Not sure what's hapenning in GH actions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you look at the failing tests, there are some run sucesfully before eventually one fails, so adding a sleep might not make any difference...

Example run from current master: https://github.com/typeorm/typeorm/actions/runs/19611788411/job/56160388241

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, our test setup isn't that great. Those tests are running but returning immediately because the current driver is not enabled.

Ideally we should have a system where we can tag a test with e.g. [mysql][mssql] and then run the tests just for one tag, so these tests don't show up.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

💪👍

steps:
- uses: actions/checkout@v5

- run: docker compose up oracle --detach
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we run docker compose up orcale twice in this job? Here and in 302?

And just from my own curiosity, why don't we use services like with any other db?

Copy link
Collaborator

Choose a reason for hiding this comment

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

--detach starts the container in the background, --no-recreate --wait will attach to the container and wait until the healthcheck is passing

@pkuczynski pkuczynski changed the title ci(tests): try fix flaky test for Oracle on Node 20 when container starts ci(oracle): add extra sleep after container starts Nov 23, 2025
@OSA413 OSA413 merged commit ea0f155 into typeorm:master Nov 24, 2025
62 checks passed
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants