Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable more std tests for interpreter #14016

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/interpreter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
test-interpreter-std_spec:
needs: build-interpreter
runs-on: ubuntu-22.04
timeout-minutes: 90
container:
image: crystallang/crystal:1.10.1-build
strategy:
matrix:
part: [0, 1, 2, 3]
name: "Test std_spec with interpreter (${{ matrix.part }})"
env:
HANDLE_SIGNAL_IN_INTERPRETER: "1"
name: "Test std_spec with interpreter"
steps:
- uses: actions/checkout@v4

Expand All @@ -61,4 +61,19 @@ jobs:
run: chmod +x .build/crystal

- name: Run std_spec with interpreter
run: SPEC_SPLIT="${{ matrix.part }}%4" bin/crystal i spec/interpreter_std_spec.cr -- --junit_output .junit/interpreter-std_spec.${{ matrix.part }}.xml
shell: bash
run: |
set -e
export HANDLE_SIGNAL_IN_INTERPRETER=1
status=0
for part in $(seq 0 15); do
echo "Running part ${part} of 15"
timeout 900 env SPEC_SPLIT="${part}%16" bin/crystal i spec/interpreter_std_spec.cr -- --junit_output .junit/interpreter-std_spec.${part}.xml 2> /dev/null
job_status=$?
echo $job_status
if [ $job_status -ne 0 ]; then
status=$job_status
fi
done
echo "final status: ${status}"
exit $status
3 changes: 3 additions & 0 deletions spec/generate_interpreter_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ set +x
export SPEC_SUITE=$1
export OUT_FILE=$2
export CRYSTAL_BIN=${CRYSTAL_BIN:-./bin/crystal}
# Enable signal handlers in interpreted code
export HANDLE_SIGNAL_IN_INTERPRETER=1

job_size=${3:-64}

command="$0 $*"
Expand Down
16 changes: 8 additions & 8 deletions spec/interpreter_std_spec.cr

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spec/std/time/format_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "../spec_helper"
require "../../support/time"
require "spec/helpers/string"

def parse_time(format, string)
Expand Down
1 change: 1 addition & 0 deletions spec/std/time/time_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "../spec_helper"
require "../../support/time"
require "spec/helpers/iterate"

CALENDAR_WEEK_TEST_DATA = [
Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/signal.cr
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module Crystal::System::Signal
end
end

private def self.start_loop
def self.start_loop
spawn(name: "Signal Loop") do
loop do
value = reader.read_bytes(Int32)
Expand Down
7 changes: 7 additions & 0 deletions src/kernel.cr
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,10 @@ end
Crystal::Scheduler.init_workers
{% end %}
{% end %}

{% if flag?(:interpreted) %}
if ENV["HANDLE_SIGNAL_IN_INTERPRETER"]? == "1"
Signal::CHLD.reset
Crystal::System::Signal.start_loop
end
{% end %}
Loading