Skip to content

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Nov 21, 2025

High Level Overview of Change

This PR adds a simple infinite loop test. It passes in negligible time.

Note: this PR shouldn't be merged until the Wasmi changes are added to the base branch. This test has been verified locally against that branch, but CI isn't passing yet.

Context of Change

Testing

Type of Change

  • Tests (you added tests for code that already exists, or your new feature included in this PR)

API Impact

N/A

Test Plan

Added a test. It passed efficiently.

@mvadari mvadari changed the base branch from ripple/smart-escrow2 to ripple/wamr-host-functions November 21, 2025 10:43
@mvadari mvadari added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Nov 21, 2025
@mvadari mvadari marked this pull request as draft November 21, 2025 10:44
@mvadari mvadari marked this pull request as ready for review November 21, 2025 11:04
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.1%. Comparing base (c145598) to head (dc5f0ec).

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                      @@
##           ripple/wasmi-host-functions   #6064     +/-   ##
=============================================================
- Coverage                         79.1%   79.1%   -0.0%     
=============================================================
  Files                              827     827             
  Lines                            70993   70993             
  Branches                          8304    8302      -2     
=============================================================
- Hits                             56133   56128      -5     
- Misses                           14860   14865      +5     

see 3 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mvadari mvadari marked this pull request as draft November 21, 2025 17:39
@mvadari mvadari changed the base branch from ripple/wamr-host-functions to ripple/wasmi-host-functions December 2, 2025 17:35
@mvadari mvadari changed the title [DO NOT MERGE] infinite loop test infinite loop test Dec 2, 2025
@mvadari mvadari marked this pull request as ready for review December 2, 2025 21:51
@mvadari mvadari removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Dec 2, 2025
Copilot finished reviewing on behalf of mvadari December 2, 2025 23:04
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 adds a test to verify that WebAssembly infinite loops are properly detected and handled. The test expects infinite loop execution to be caught and return a tecFAILED_PROCESSING error efficiently.

  • Adds testInfiniteLoop() test function with embedded WASM bytecode containing an infinite loop
  • Integrates the new test into the test suite execution
  • Tests that infinite loops fail appropriately with tecFAILED_PROCESSING error code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return x;
}
*/
static std::string const infiniteWasmHex =
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be in fixtures.cpp

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left it here because it's only used once. Would you prefer it still go into fixtures?

}

void
testInfiniteLoop()
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be better to put it next to recursion too deep test. It is not so unique test to put it into dedicated function.

using namespace test::jtx;
Env env{*this};

/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be in fixtures sources. here you can leave source file name

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