Skip to content

Integration test: Enable EventExample test #178

@KrisSimon

Description

@KrisSimon

Current Status

The EventExample integration test is currently skipped in CI.

Skip Reason

Concurrent event handlers have non-deterministic output order.

Problem Description

The EventExample demonstrates ARO's event system with multiple concurrent event handlers. When events are emitted, handlers execute in parallel via Swift's TaskGroup, resulting in:

  • Non-deterministic execution order
  • Output lines appearing in different orders between runs
  • Platform-dependent scheduling behavior

What Must Be Done to Enable

Option 1: Use occurrence-check mode (Recommended)

  • Add occurrence-check: true to test.hint
  • This allows lines to appear in any order as long as all expected lines are present
  • Works well for event-driven code with concurrent handlers

Option 2: Refactor to sequential execution

  • Modify the example to execute handlers sequentially
  • Less representative of real event-driven behavior
  • Not recommended as it changes the example's purpose

Option 3: Output aggregation

  • Collect all handler outputs and sort before comparing
  • Requires runtime changes to aggregate event handler outputs

Option 4: Statistical testing

  • Run multiple times and ensure output contains expected content
  • More complex test infrastructure needed

Recommended Fix

# In Examples/EventExample/test.hint
mode: interpreter
occurrence-check: true

Then regenerate expected.txt with unique identifying lines.

Files

  • Examples/EventExample/main.aro
  • Examples/EventExample/test.hint
  • Examples/EventExample/expected.txt

Labels

integration-test, events, concurrency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions