Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,3 @@ jobs:
# - name: Stop PostgreSQL after pg_regress
# if: steps.pg_regress.outcome != 'skipped'
# run: ./scripts/pg-stop.sh

# - name: Stop PostgreSQL after pg_regress
# if: steps.pg_regress.outcome != 'skipped'
# run: ./scripts/pg-reset.sh
4 changes: 2 additions & 2 deletions scripts/pg-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ if [ -f "$PG_CONF" ]; then

# Configure pg_durable.database_name GUC if provided
if [ -n "$DATABASE_GUC" ]; then
# Remove any existing pg_durable.database_name setting
sed -i '/^pg_durable\.database_name/d' "$PG_CONF"
# Remove any existing pg_durable.database_name setting (portable sed -i usage)
sed -i.bak '/^pg_durable\.database_name/d' "$PG_CONF" && rm -f "$PG_CONF.bak"
echo -e "\033[0;33mSetting pg_durable.database_name = '$DATABASE_GUC'...\033[0m"
echo "pg_durable.database_name = '$DATABASE_GUC'" >> "$PG_CONF"
fi
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub extern "C-unwind" fn _PG_init() {
pgrx::GucFlags::default(),
);

// Don't start the background worker during pgrx tests to avoid database locking issues
#[cfg(not(feature = "pg_test"))]
worker::register_background_worker();
}

Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/sql/25_extension_creation_security.sql
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ BEGIN
RAISE NOTICE 'PASS: Worker initialized duroxide-pg after recreation';
END $$;

-- Give the worker additional time to fully complete initialization
-- This avoids race conditions with migration conflicts when client connects
SELECT pg_sleep(1);

-- Verify extension schemas and ownership
DO $$
DECLARE
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/sql/26_drop_create_loop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ BEGIN
RAISE NOTICE 'PASS: Worker initialized duroxide-pg after cycle 1';
END $$;

-- Give the worker additional time to fully complete initialization
-- This avoids race conditions with migration conflicts when client connects
SELECT pg_sleep(1);

-- Verify operational with a simple durable function
CREATE TEMP TABLE _cycle1_state (instance_id TEXT);
INSERT INTO _cycle1_state
Expand Down Expand Up @@ -100,6 +104,9 @@ BEGIN
RAISE NOTICE 'PASS: Worker initialized duroxide-pg after cycle 2';
END $$;

-- Give the worker additional time to fully complete initialization
SELECT pg_sleep(1);

-- Verify operational again
CREATE TEMP TABLE _cycle2_state (instance_id TEXT);
INSERT INTO _cycle2_state
Expand Down Expand Up @@ -156,6 +163,9 @@ BEGIN
RAISE NOTICE 'PASS: Worker initialized duroxide-pg after cycle 3';
END $$;

-- Give the worker additional time to fully complete initialization
SELECT pg_sleep(1);

-- Verify operational one more time
CREATE TEMP TABLE _cycle3_state (instance_id TEXT);
INSERT INTO _cycle3_state
Expand Down
Loading