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

Date_Time_Spec test failure Zone offset not in valid range #7655

Closed
GregoryTravis opened this issue Aug 24, 2023 · 9 comments
Closed

Date_Time_Spec test failure Zone offset not in valid range #7655

GregoryTravis opened this issue Aug 24, 2023 · 9 comments
Assignees
Labels
-libs Libraries: New libraries to be implemented p-medium Should be completed in the next few sprints x-on-hold

Comments

@GregoryTravis
Copy link
Contributor

Getting this error running Date_Time_Spec on develop:

Execution finished with an error: java.time.DateTimeException: Zone offset not in valid range: -18:00 to +18:00
        at <java> java.base/java.time.ZoneOffset.ofTotalSeconds(ZoneOffset.java:417)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObject.createZoneId(PythonAbstractObject.java:1001)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObject.asTimeZone(PythonAbstractObject.java:949)
@hubertp hubertp added the -libs Libraries: New libraries to be implemented label Aug 25, 2023
@GregoryTravis
Copy link
Contributor Author

This is happening for me only in the Python tests.

@GregoryTravis GregoryTravis added the p-medium Should be completed in the next few sprints label Aug 25, 2023
@JaroslavTulach
Copy link
Member

JaroslavTulach commented Aug 26, 2023

I assume you have America/New Your time zone. Can you share longer stacktrace that would show a code in our codebase to put breakpoint to? Can you add Enso stacktrace as well?

This is happening for me only in the Python tests.

Obviously when com.oracle.graal.python.builtins.objects.PythonAbstractObject is a class from Graal Python project ;-)

@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Aug 29, 2023
@GregoryTravis
Copy link
Contributor Author

Full stack trace:

Execution finished with an error: java.time.DateTimeException: Zone offset not in valid range: -18:00 to +18:00
        at <java> java.base/java.time.ZoneOffset.ofTotalSeconds(ZoneOffset.java:417)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObject.createZoneId(PythonAbstractObject.java:1001)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObject.asTimeZone(PythonAbstractObject.java:949)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObjectGen$InteropLibraryExports$Cached.asTimeZoneNode_AndSpecialize(PythonAbstractObjectGen.java:2965)
        at <java> com.oracle.graal.python.builtins.objects.PythonAbstractObjectGen$InteropLibraryExports$Cached.asTimeZone(PythonAbstractObjectGen.java:2855)
        at <java> org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.asTimeZone(InteropLibraryGen.java:9304)
        at <java> org.enso.interpreter.node.callable.InvokeMethodNode.doConvertZonedDateTime(InvokeMethodNode.java:723)
        at <java> org.enso.interpreter.node.callable.InvokeMethodNodeGen.executeAndSpecialize(InvokeMethodNodeGen.java:1430)
        at <java> org.enso.interpreter.node.callable.InvokeMethodNodeGen.execute(InvokeMethodNodeGen.java:506)
        at <java> org.enso.interpreter.node.callable.InvokeCallableNode.invokeDynamicSymbol(InvokeCallableNode.java:254)
        at <java> org.enso.interpreter.node.callable.InvokeCallableNodeGen.execute(InvokeCallableNodeGen.java:137)
        at <java> org.enso.interpreter.node.callable.ApplicationNode.executeGeneric(ApplicationNode.java:96)
        at <java> org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
        at <enso> Date_Time_Spec.spec_with<arg-0>(Internal)
        at <enso> Date_Time_Spec.spec_with<arg-1>(Date_Time_Spec.enso:111:13-43)
        at <enso> Test.run_spec<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:200:18-25)
        at <enso> Panic.catch(Internal)
        at <enso> Panic.type.recover(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Panic.enso:185-190)
        at <enso> Test.run_spec(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:199-203)
        at <enso> case_branch<arg-3>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:77:73-89)
        at <enso> case_branch<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:77:49-90)
        at <enso> Runtime.no_inline(Internal)
        at <enso> Duration.type.time_execution(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Time/Duration.enso:127:18-43)
        at <enso> case_branch(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:77:24-91)
        at <enso> Test.specify(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:76-78)
        at <enso> Date_Time_Spec.spec_with<arg-1>(Date_Time_Spec.enso:109-118)
        at <enso> case_branch<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:40:29-37)
        at <enso> case_branch<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:39-41)
        at <enso> Panic.catch(Internal)
        at <enso> case_branch(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:38-41)
        at <enso> Test.group<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:31-46)
        at <enso> Test.group(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test.enso:30-46)
        at <enso> Date_Time_Spec.spec_with(Date_Time_Spec.enso:55-858)
        at <enso> Date_Time_Spec.spec<arg-1>(Date_Time_Spec.enso:27:9-126)
        at <enso> Date_Time_Spec.spec(Date_Time_Spec.enso:23-27)
        at <enso> Date_Time_Spec.main<arg-1>(Date_Time_Spec.enso:939:28-31)
        at <enso> Test_Suite.type.run<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Suite.enso:69:17-21)
        at <enso> Test_Suite.type.run<arg-1>(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Suite.enso:68-70)
        at <enso> Test_Reporter.wrap_junit_testsuites(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Reporter.enso:18:14-19)
        at <enso> Test_Suite.type.run(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Suite.enso:67-70)
        at <enso> Test_Suite.type.run_main(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-amd64/enso-0.0.0-dev/lib/Standard/Test/0.0.0-dev/src/Test_Suite.enso:40:13-39)
        at <enso> Date_Time_Spec.main(Date_Time_Spec.enso:939:8-31)

@GregoryTravis
Copy link
Contributor Author

There is no enso stack trace. Full output:

out.txt

@JaroslavTulach
Copy link
Member

@GregoryTravis please try to "debug out" some more info. For example: Can you print out the time and its zone just before the error? Something like:

enso$ git diff test
diff --git test/Tests/src/Data/Time/Date_Time_Spec.enso test/Tests/src/Data/Time/Date_Time_Spec.enso
index dc61e3b8e4..50daf3689c 100644
--- test/Tests/src/Data/Time/Date_Time_Spec.enso
+++ test/Tests/src/Data/Time/Date_Time_Spec.enso
@@ -108,6 +108,8 @@ spec_with name create_new_datetime parse_datetime nanoseconds_loss_in_precision=
 
         Test.specify "should parse local time adding system zone" <|
             time = parse_datetime "1970-01-01T00:00:01"
+            IO.println <| Objects.toString time
+            IO.println <| Objects.toString time.zone
             time . year . should_equal 1970
             time . month . should_equal 1
             time . day . should_equal 1

@JaroslavTulach
Copy link
Member

The printed time:

datetime.datetime(1970, 1, 1, 0, 0, 1, tzinfo=<__main__.EnsoTzInfo object at 0x3f90f77a>)

@JaroslavTulach
Copy link
Member

JaroslavTulach commented Oct 11, 2023

I can reprodue the problem relatively easily:

diff --git test/Tests/src/Data/Time/Date_Time_Spec.enso test/Tests/src/Data/Time/Date_Time_Spec.enso
index 613ff1b1d8..a9d0f24094 100644
--- test/Tests/src/Data/Time/Date_Time_Spec.enso
+++ test/Tests/src/Data/Time/Date_Time_Spec.enso
@@ -134,6 +134,16 @@ spec_with name create_new_datetime parse_datetime nanoseconds_loss_in_precision=
             dt1.zone . zone_id . should_equal interop_tz.zone_id
             dt1.to_display_text . should_equal "2020-01-01 01:00:00 +01:00"
 
+        Test.specify "epoch in New York" <|
+            tz = Time_Zone.parse "America/New_York"
+            time = create_new_datetime zone=tz 1970 1 1 0 0 1
+            time . hour . should_equal 0
+            time . minute . should_equal 0
+            time . second . should_equal 1
+            time . millisecond . should_equal 0
+            time . microsecond . should_equal 0
+            time . nanosecond . should_equal 0
+
         Test.specify "should get time of day from offsed-based time" <|
             time = parse_datetime "1970-01-01T00:00:01+01:00" . time_of_day
             time . hour . should_equal 0

the problem however cannot be fixed on our side. It requires changes to GraalPy: submitted as https://github.com/oracle/graalpython/pull/360/files

@jdunkerley
Copy link
Member

To be tested against the GraalVM fixes they have delivered.

@JaroslavTulach
Copy link
Member

Fixed by some upgrade of GraalVM that brought in oracle/graalpython#360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs Libraries: New libraries to be implemented p-medium Should be completed in the next few sprints x-on-hold
Projects
Archived in project
Development

No branches or pull requests

4 participants