Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS
@ 2026-07-02 14:28 Sergey Kaplun via Tarantool-patches
  2026-07-02 14:45 ` Evgeniy Temirgaleev via Tarantool-patches
  2026-07-02 16:02 ` Sergey Bronnikov via Tarantool-patches
  0 siblings, 2 replies; 4+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2026-07-02 14:28 UTC (permalink / raw)
  To: Sergey Bronnikov, Evgeniy Temirgaleev; +Cc: tarantool-patches

RED OS for some reason sets `errno` to 2 ENOENT ("No such file or
directory") after the call to `mktime()`. So just skip the test for it.
---

Branch: https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos
Failed workflow: https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692

Side note: The errno is set for __any__ call to the `mktime()`.

Tested inside the following Docker:

===================================================================
FROM registry.red-soft.ru/ubi8/ubi-minimal:latest

RUN dnf update -y && \
    dnf install -y cmake vim make git curl gcc g++ gdb man && \
    dnf clean all
===================================================================

| docker build . --tag redos
| docker run --network=host -ti redos bash

Then clone LuaJIT and proceed as usual.

With the patch the test skipped:
| 1..0 # SKIP RedOS incrorrect behaviour for mktime

 .../lj-1470-os-time-epoch-minus-1s.test.lua    | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
index dfe1ee11..ebfe6f22 100644
--- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
+++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
@@ -1,9 +1,25 @@
 local tap = require('tap')
 
+local function detect_redos()
+  local read_file = require('utils').tools.read_file
+  local hasfile, data = pcall(read_file, '/etc/os-release')
+  if not hasfile then
+    -- Not Linux probably, so not the Red OS.
+    return false
+  else
+    return data:match('RED OS')
+  end
+end
+
 -- The test file demonstrates os.time() fail to return -1 time
 -- value.
 -- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
-local test = tap.test('lj-1470-os-time-epoch-minus-1s')
+local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
+  -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
+  -- such file or directory") after the call to `mktime()`. So
+  -- just skip the test for it.
+  ['RED OS incrorrect behaviour for mktime'] = detect_redos(),
+})
 
 test:plan(1)
 
-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches]  [PATCH luajit] test: skip lj-1470 test on RED OS
  2026-07-02 14:28 [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS Sergey Kaplun via Tarantool-patches
@ 2026-07-02 14:45 ` Evgeniy Temirgaleev via Tarantool-patches
  2026-07-02 16:02 ` Sergey Bronnikov via Tarantool-patches
  1 sibling, 0 replies; 4+ messages in thread
From: Evgeniy Temirgaleev via Tarantool-patches @ 2026-07-02 14:45 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]

Hi, Sergey!

Thanks for the patch! LGTM.

--
Best regards,
Evgeniy Temirgaleev

> 
> From: Sergey Kaplun <skaplun@tarantool.org>
> To: Sergey Bronnikov <sergeyb@tarantool.org>, Evgeniy Temirgaleev <e.temirgaleev@tarantool.org
> >
> Cc: tarantool-patches@dev.tarantool.org, Sergey Kaplun <skaplun@tarantool.org
> >
> Date: Thursday, July 2, 2026 5:28 PM +03:00
> RED OS for some reason sets `errno` to 2 ENOENT ("No such file or
> directory") after the call to `mktime()`. So just skip the test for it.
> ---
> 
> Branch: https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos
> 
> Failed workflow: https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692
> 
> 
> Side note: The errno is set for __any__ call to the `mktime()`.
> 
> Tested inside the following Docker:
> 
> ===================================================================
> FROM registry.red-soft.ru/ubi8/ubi-minimal:latest
> 
> RUN dnf update -y && \
> dnf install -y cmake vim make git curl gcc g++ gdb man && \
> dnf clean all
> ===================================================================
> 
> | docker build . --tag redos
> | docker run --network=host -ti redos bash
> 
> Then clone LuaJIT and proceed as usual.
> 
> With the patch the test skipped:
> | 1..0 # SKIP RedOS incrorrect behaviour for mktime
> 
> .../lj-1470-os-time-epoch-minus-1s.test.lua | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> index dfe1ee11..ebfe6f22 100644
> --- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> @@ -1,9 +1,25 @@
> local tap = require('tap')
> 
> +local function detect_redos()
> + local read_file = require('utils').tools.read_file
> + local hasfile, data = pcall(read_file, '/etc/os-release')
> + if not hasfile then
> + -- Not Linux probably, so not the Red OS.
> + return false
> + else
> + return data:match('RED OS')
> + end
> +end
> +
> -- The test file demonstrates os.time() fail to return -1 time
> -- value.
> -- See also: https://github.com/LuaJIT/LuaJIT/issues/1470.
> -local test = tap.test('lj-1470-os-time-epoch-minus-1s')
> +local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
> + -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
> + -- such file or directory") after the call to `mktime()`. So
> + -- just skip the test for it.
> + ['RED OS incrorrect behaviour for mktime'] = detect_redos(),
> +})
> 
> test:plan(1)
> 
> --
> 2.54.0
>

[-- Attachment #2: Type: text/html, Size: 3812 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS
  2026-07-02 14:28 [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS Sergey Kaplun via Tarantool-patches
  2026-07-02 14:45 ` Evgeniy Temirgaleev via Tarantool-patches
@ 2026-07-02 16:02 ` Sergey Bronnikov via Tarantool-patches
  2026-07-02 16:30   ` Sergey Bronnikov via Tarantool-patches
  1 sibling, 1 reply; 4+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2026-07-02 16:02 UTC (permalink / raw)
  To: Sergey Kaplun, Evgeniy Temirgaleev; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 3160 bytes --]

Sergey,

thanks for the patch! See my comments.

Sergey

On 7/2/26 17:28, Sergey Kaplun wrote:
> RED OS for some reason sets `errno` to 2 ENOENT ("No such file or
> directory") after the call to `mktime()`. So just skip the test for it.
> ---
>
> Branch:https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos
> Failed workflow:https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692
>
> Side note: The errno is set for __any__ call to the `mktime()`.
>
> Tested inside the following Docker:
>
> ===================================================================
> FROM registry.red-soft.ru/ubi8/ubi-minimal:latest
>
> RUN dnf update -y && \
>      dnf install -y cmake vim make git curl gcc g++ gdb man && \
>      dnf clean all
> ===================================================================
>
> | docker build . --tag redos
> | docker run --network=host -ti redos bash
>
> Then clone LuaJIT and proceed as usual.
>
> With the patch the test skipped:
> | 1..0 # SKIP RedOS incrorrect behaviour for mktime
>
>   .../lj-1470-os-time-epoch-minus-1s.test.lua    | 18 +++++++++++++++++-
>   1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> index dfe1ee11..ebfe6f22 100644
> --- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
> @@ -1,9 +1,25 @@
>   local tap = require('tap')
>   
> +local function detect_redos()
> +  local read_file = require('utils').tools.read_file
> +  local hasfile, data = pcall(read_file, '/etc/os-release')
> +  if not hasfile then
> +    -- Not Linux probably, so not the Red OS.
> +    return false
> +  else
> +    returndata:match('RED OS')
> +  end
> +end

Why do you think the problem is in RedOS, not in Glibc?

I propose skipping test for some Glibc version using CMake macro

introduced in the following commit:

commit af0f59da76292f30ff75be1ab01458d47b226995
Author: Sergey Kaplun <skaplun@tarantool.org>
Date:   Wed Dec 4 15:03:56 2024 +0300

     test: fix LuaJIT-tests for old libc version

Otherwise, we will skip this test for always for RedOS.

in RedOS 8 glibc version is 2.36-14:

[root@pony /]# rpm -qa | grep glibc
glibc-common-2.36-14.red80.x86_64
glibc-gconv-extra-2.36-14.red80.x86_64
glibc-langpack-en-2.36-14.red80.x86_64
glibc-langpack-ru-2.36-14.red80.x86_64
glibc-2.36-14.red80.x86_64
glibc-devel-2.36-14.red80.x86_64



Also, why detect_redos() is not in utils.lua?

> +
>   -- The test file demonstrates os.time() fail to return -1 time
>   -- value.
>   -- See also:https://github.com/LuaJIT/LuaJIT/issues/1470.
> -local test = tap.test('lj-1470-os-time-epoch-minus-1s')
> +local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
> +  -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
> +  -- such file or directory") after the call to `mktime()`. So
> +  -- just skip the test for it.
> +  ['RED OS incrorrect behaviour for mktime'] = detect_redos(),
> +})
>   
>   test:plan(1)
>   

[-- Attachment #2: Type: text/html, Size: 4528 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS
  2026-07-02 16:02 ` Sergey Bronnikov via Tarantool-patches
@ 2026-07-02 16:30   ` Sergey Bronnikov via Tarantool-patches
  0 siblings, 0 replies; 4+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2026-07-02 16:30 UTC (permalink / raw)
  To: Sergey Kaplun, Evgeniy Temirgaleev; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 5134 bytes --]

Sergey,

seems it is not an OS-specific issue.

strace reports that glibc is looking for /etc/localtime, but the file 
does not exist:

strace ./src/luajit -e "print(os.time(os.date('*t', -1)))"

<snipped>

futex(0x70d8ab961070, FUTEX_WAKE_PRIVATE, 2147483647) = 0
rt_sigaction(SIGINT, {sa_handler=0x4057e5, sa_mask=[INT], 
sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, 
{sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No 
such file or directory)
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No 
such file or directory)
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}, 
AT_EMPTY_PATH) = 0
write(1, "nil\n", 4nil
)                    = 4
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[INT], 
sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x70d8ab79bfd0}, 
{sa_handler=0x4057e5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, 
sa_restorer=0x70d8ab79bfd0}, 8) = 0
munmap(0x414e2000, 131072)              = 0
exit_group(0)                           = ?
+++ exited with 0 +++


The same issue can be reproduced on other Linux distros after removing 
/etc/localtime.

On redOS the issue can be fixed by creating a symlink:

ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime

<snipped>

ctest -V -R lj-1470-os-time-epoch-minus-1s.test.lua

<snipped>

The following tests passed:
test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua

100% tests passed, 0 tests failed out of 1

Label Time Summary:
tarantool-tests    =   0.00 sec*proc (1 test)

Total Test time (real) =   0.01 sec


I propose checking a file /etc/localtime instead checking an OS name, 
this will be a more correct fix.

However, LGTM, I will not insist.

Sergey

On 7/2/26 19:02, Sergey Bronnikov wrote:
>
> Sergey,
>
> thanks for the patch! See my comments.
>
> Sergey
>
> On 7/2/26 17:28, Sergey Kaplun wrote:
>> RED OS for some reason sets `errno` to 2 ENOENT ("No such file or
>> directory") after the call to `mktime()`. So just skip the test for it.
>> ---
>>
>> Branch:https://github.com/tarantool/luajit/tree/skaplun/fix-os-time-test-redos
>> Failed workflow:https://github.com/tarantool/tarantool/actions/runs/28585213455/job/84775371860?pr=12886#step:5:20692
>>
>> Side note: The errno is set for __any__ call to the `mktime()`.
>>
>> Tested inside the following Docker:
>>
>> ===================================================================
>> FROM registry.red-soft.ru/ubi8/ubi-minimal:latest
>>
>> RUN dnf update -y && \
>>      dnf install -y cmake vim make git curl gcc g++ gdb man && \
>>      dnf clean all
>> ===================================================================
>>
>> | docker build . --tag redos
>> | docker run --network=host -ti redos bash
>>
>> Then clone LuaJIT and proceed as usual.
>>
>> With the patch the test skipped:
>> | 1..0 # SKIP RedOS incrorrect behaviour for mktime
>>
>>   .../lj-1470-os-time-epoch-minus-1s.test.lua    | 18 +++++++++++++++++-
>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
>> index dfe1ee11..ebfe6f22 100644
>> --- a/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
>> +++ b/test/tarantool-tests/lj-1470-os-time-epoch-minus-1s.test.lua
>> @@ -1,9 +1,25 @@
>>   local tap = require('tap')
>>   
>> +local function detect_redos()
>> +  local read_file = require('utils').tools.read_file
>> +  local hasfile, data = pcall(read_file, '/etc/os-release')
>> +  if not hasfile then
>> +    -- Not Linux probably, so not the Red OS.
>> +    return false
>> +  else
>> +    returndata:match('RED OS')
>> +  end
>> +end
>
> Why do you think the problem is in RedOS, not in Glibc?
>
> I propose skipping test for some Glibc version using CMake macro
>
> introduced in the following commit:
>
> commit af0f59da76292f30ff75be1ab01458d47b226995
> Author: Sergey Kaplun <skaplun@tarantool.org>
> Date:   Wed Dec 4 15:03:56 2024 +0300
>
>     test: fix LuaJIT-tests for old libc version
>
> Otherwise, we will skip this test for always for RedOS.
>
> in RedOS 8 glibc version is 2.36-14:
>
> [root@pony /]# rpm -qa | grep glibc
> glibc-common-2.36-14.red80.x86_64
> glibc-gconv-extra-2.36-14.red80.x86_64
> glibc-langpack-en-2.36-14.red80.x86_64
> glibc-langpack-ru-2.36-14.red80.x86_64
> glibc-2.36-14.red80.x86_64
> glibc-devel-2.36-14.red80.x86_64
>
>
>
> Also, why detect_redos() is not in utils.lua?
>
>> +
>>   -- The test file demonstrates os.time() fail to return -1 time
>>   -- value.
>>   -- See also:https://github.com/LuaJIT/LuaJIT/issues/1470.
>> -local test = tap.test('lj-1470-os-time-epoch-minus-1s')
>> +local test = tap.test('lj-1470-os-time-epoch-minus-1s'):skipcond({
>> +  -- XXX: RED OS for some reason sets `errno` to 2 ENOENT ("No
>> +  -- such file or directory") after the call to `mktime()`. So
>> +  -- just skip the test for it.
>> +  ['RED OS incrorrect behaviour for mktime'] = detect_redos(),
>> +})
>>   
>>   test:plan(1)
>>   

[-- Attachment #2: Type: text/html, Size: 7424 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-02 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-02 14:28 [Tarantool-patches] [PATCH luajit] test: skip lj-1470 test on RED OS Sergey Kaplun via Tarantool-patches
2026-07-02 14:45 ` Evgeniy Temirgaleev via Tarantool-patches
2026-07-02 16:02 ` Sergey Bronnikov via Tarantool-patches
2026-07-02 16:30   ` Sergey Bronnikov via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox