diff --git a/.github/workflows/test-linux-wheel.yml b/.github/workflows/test-linux-wheel.yml index 8172534d..4f985da7 100644 --- a/.github/workflows/test-linux-wheel.yml +++ b/.github/workflows/test-linux-wheel.yml @@ -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' }} diff --git a/.github/workflows/test-mac-wheel.yml b/.github/workflows/test-mac-wheel.yml index a856a213..be5f2668 100644 --- a/.github/workflows/test-mac-wheel.yml +++ b/.github/workflows/test-mac-wheel.yml @@ -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' }} diff --git a/.github/workflows/test-windows-wheel.yml b/.github/workflows/test-windows-wheel.yml index 05c0e0f4..51e1a589 100644 --- a/.github/workflows/test-windows-wheel.yml +++ b/.github/workflows/test-windows-wheel.yml @@ -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: diff --git a/python_tests/test_refresh.py b/python_tests/test_refresh.py index 1bc8d0ee..93283c6d 100644 --- a/python_tests/test_refresh.py +++ b/python_tests/test_refresh.py @@ -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) @@ -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 diff --git a/src/dbzero/core/storage/CFile.cpp b/src/dbzero/core/storage/CFile.cpp index 6d09701a..f5cf71e2 100644 --- a/src/dbzero/core/storage/CFile.cpp +++ b/src/dbzero/core/storage/CFile.cpp @@ -52,11 +52,9 @@ namespace db0 auto duration = tp.time_since_epoch(); return std::chrono::duration_cast(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(duration).count(); #else struct stat st; if (stat(file_name, &st)) {