Skip to content

Commit 88a62b9

Browse files
Bugfix/test wheels ci (#637)
* fix(ci): fixet test-wheels actions. closes #issue-622
1 parent 21ce0c5 commit 88a62b9

5 files changed

Lines changed: 35 additions & 9 deletions

File tree

.github/workflows/test-linux-wheel.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,17 @@ on:
4949
default: "-m 'not integration_test' -m 'not stress_test'"
5050

5151
jobs:
52+
build-wheel:
53+
if: github.event_name == 'workflow_dispatch'
54+
uses: ./.github/workflows/build-linux-wheel.yml
55+
with:
56+
python-version: ${{ inputs.python-version }}
57+
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
58+
5259
test-wheels-linux:
5360
runs-on: ubuntu-latest
61+
needs: [build-wheel]
62+
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
5463
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
5564
env:
5665
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}

.github/workflows/test-mac-wheel.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ on:
4040
default: "-m 'not integration_test' -m 'not stress_test'"
4141

4242
jobs:
43+
build-wheel:
44+
if: github.event_name == 'workflow_dispatch'
45+
uses: ./.github/workflows/build-mac-wheel.yml
46+
with:
47+
python-version: ${{ inputs.python-version }}
48+
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
49+
4350
test-wheels-macos:
4451
runs-on: macos-latest
52+
needs: [build-wheel]
53+
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
4554
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
4655
env:
4756
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}

.github/workflows/test-windows-wheel.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@ on:
2222
default: '3.12'
2323

2424
jobs:
25+
build-wheel:
26+
if: github.event_name == 'workflow_dispatch'
27+
uses: ./.github/workflows/build-windows-wheel.yml
28+
with:
29+
python-version: ${{ inputs.python-version }}
30+
python-tag: ${{ inputs.python-version == '3.9' && '39' || inputs.python-version == '3.10' && '310' || inputs.python-version == '3.11' && '311' || inputs.python-version == '3.12' && '312' || inputs.python-version == '3.13' && '313' || '314' }}
31+
architecture: "AMD64"
32+
2533
test-windows:
2634
runs-on: windows-latest
35+
needs: [build-wheel]
36+
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
2737
env:
2838
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}
2939
steps:

python_tests/test_refresh.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# to verify that refresh works correctly with custom page_io_step_size
1515

1616
pytestmark = pytest.mark.parametrize("db0_fixture", [
17-
{}, # default parameters
18-
{"page_io_step_size": 16 << 10} # with custom page_io_step_size
17+
{"autocommit":False}, # default parameters
18+
{"autocommit":False, "page_io_step_size": 16 << 10} # with custom page_io_step_size
1919
], indirect=True)
2020

2121

@@ -471,13 +471,13 @@ async def test_async_wait_for_updates(db0_fixture):
471471
# Start waiting before transactions complete
472472
current_num = db0.get_state_num(prefix)
473473
make_trasaction(writer_sem, 5)
474-
assert await with_timeout(db0.async_wait(prefix, current_num + 5), 1)
474+
assert await with_timeout(db0.async_wait(prefix, current_num + 5), 2)
475475

476476
# Start waiting after transactions complete
477477
current_num = db0.get_state_num(prefix)
478478
make_trasaction(writer_sem, 2)
479479
time.sleep(0.5)
480-
assert await with_timeout(db0.async_wait(prefix, current_num + 1), 1)
480+
assert await with_timeout(db0.async_wait(prefix, current_num + 2), 1)
481481

482482
current_num = db0.get_state_num(prefix)
483483
# Wait current state

src/dbzero/core/storage/CFile.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ namespace db0
5252
auto duration = tp.time_since_epoch();
5353
return std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
5454
#elif defined(__APPLE__)
55-
struct stat st;
56-
if (stat(file_name, &st)) {
57-
THROWF(db0::IOException) << "CFile::getLastModifiedTime: stat failed";
58-
};
59-
return st.st_mtimespec.tv_sec * 1000000000 + st.st_mtimespec.tv_nsec;
55+
auto tp = fs::last_write_time(fs::path(file_name));
56+
auto duration = tp.time_since_epoch();
57+
return std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
6058
#else
6159
struct stat st;
6260
if (stat(file_name, &st)) {

0 commit comments

Comments
 (0)