Skip to content
9 changes: 9 additions & 0 deletions .github/workflows/test-linux-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ on:
default: "-m 'not integration_test' -m 'not stress_test'"

jobs:
build-wheel:
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-linux-wheel.yml
with:
python-version: ${{ inputs.python-version }}
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}

test-wheels-linux:
runs-on: ubuntu-latest
needs: [build-wheel]
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
env:
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test-mac-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ on:
default: "-m 'not integration_test' -m 'not stress_test'"

jobs:
build-wheel:
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-mac-wheel.yml
with:
python-version: ${{ inputs.python-version }}
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}

test-wheels-macos:
runs-on: macos-latest
needs: [build-wheel]
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
timeout-minutes: ${{ fromJSON(inputs.timeout-minutes) }}
env:
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-windows-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ on:
default: '3.12'

jobs:
build-wheel:
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-windows-wheel.yml
with:
python-version: ${{ inputs.python-version }}
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' }}
architecture: "AMD64"

test-windows:
runs-on: windows-latest
needs: [build-wheel]
if: always() && (needs.build-wheel.result == 'success' || needs.build-wheel.result == 'skipped')
env:
REQUIREMENTS_FILE: ${{ inputs.python-version == '3.9' && 'requirements.3.9.txt' || 'requirements.txt' }}
steps:
Expand Down
8 changes: 4 additions & 4 deletions python_tests/test_refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# to verify that refresh works correctly with custom page_io_step_size

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


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

# Start waiting after transactions complete
current_num = db0.get_state_num(prefix)
make_trasaction(writer_sem, 2)
time.sleep(0.5)
assert await with_timeout(db0.async_wait(prefix, current_num + 1), 1)
assert await with_timeout(db0.async_wait(prefix, current_num + 2), 1)

current_num = db0.get_state_num(prefix)
# Wait current state
Expand Down
8 changes: 3 additions & 5 deletions src/dbzero/core/storage/CFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ namespace db0
auto duration = tp.time_since_epoch();
return std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
#elif defined(__APPLE__)
struct stat st;
if (stat(file_name, &st)) {
THROWF(db0::IOException) << "CFile::getLastModifiedTime: stat failed";
};
return st.st_mtimespec.tv_sec * 1000000000 + st.st_mtimespec.tv_nsec;
auto tp = fs::last_write_time(fs::path(file_name));
auto duration = tp.time_since_epoch();
return std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
#else
struct stat st;
if (stat(file_name, &st)) {
Expand Down