From 1b7ab6d468bdb7c9546462da49a83e5f73360b41 Mon Sep 17 00:00:00 2001 From: Alek Westover Date: Fri, 16 Jun 2023 16:51:08 -0400 Subject: [PATCH] successfully upload and download the test_load extension --- alek/env.txt | 2 +- alek/output.txt | 2 +- alek/win.txt | 1 + .../regress/test_download_extensions.py | 18 ++++++++++++------ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 alek/win.txt diff --git a/alek/env.txt b/alek/env.txt index d46e4e83e9..195d5062b1 100644 --- a/alek/env.txt +++ b/alek/env.txt @@ -1 +1 @@ -{'repo_dir': PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo'), 'rust_log_override': None, 'port_distributor': , 's3_mock_server': , 'neon_cli': , 'endpoints': , 'safekeepers': [Safekeeper(env=, port=SafekeeperPort(pg=15007, http=15008), id=1, running=True), Safekeeper(env=, port=SafekeeperPort(pg=15009, http=15010), id=2, running=True), Safekeeper(env=, port=SafekeeperPort(pg=15011, http=15012), id=3, running=True)], 'broker': NeonBroker(logfile=PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo/storage_broker.log'), port=15004, neon_binpath=PosixPath('/home/alek/Desktop/neonX/target/debug'), handle=), 'remote_storage': S3Storage(bucket_name='test_file_download', bucket_region='us-east-1', access_key='test', secret_key='test', endpoint='http://127.0.0.1:15003', prefix_in_bucket=None), 'remote_storage_users': , 'pg_version': '14', 'neon_binpath': PosixPath('/home/alek/Desktop/neonX/target/debug'), 'pg_distrib_dir': PosixPath('/home/alek/Desktop/neonX/pg_install'), 'endpoint_counter': 0, 'initial_tenant': `TenantId("861cf3b88b5e53ac412227ed9fd26d10"), 'initial_timeline': TimelineId("04179cf8c30a9d3652cd39d790b4e4b7"), 'pageserver': } \ No newline at end of file +{'repo_dir': PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo'), 'rust_log_override': None, 'port_distributor': , 's3_mock_server': , 'neon_cli': , 'endpoints': , 'safekeepers': [Safekeeper(env=, port=SafekeeperPort(pg=15004, http=15005), id=1, running=True), Safekeeper(env=, port=SafekeeperPort(pg=15006, http=15007), id=2, running=True), Safekeeper(env=, port=SafekeeperPort(pg=15008, http=15009), id=3, running=True)], 'broker': NeonBroker(logfile=PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo/storage_broker.log'), port=15001, neon_binpath=PosixPath('/home/alek/Desktop/neonX/target/debug'), handle=), 'remote_storage': S3Storage(bucket_name='test_file_download', bucket_region='us-east-1', access_key='test', secret_key='test', endpoint='http://127.0.0.1:15000', prefix_in_bucket=None), 'remote_storage_users': , 'pg_version': '14', 'neon_binpath': PosixPath('/home/alek/Desktop/neonX/target/debug'), 'pg_distrib_dir': PosixPath('/home/alek/Desktop/neonX/pg_install'), 'endpoint_counter': 0, 'initial_tenant': `TenantId("1a50a17881f6b200e570982460dbf411"), 'initial_timeline': TimelineId("835f77900b841e88d7f7a8721ad3d2ba"), 'pageserver': } \ No newline at end of file diff --git a/alek/output.txt b/alek/output.txt index 50a5b6f9f0..7df48fe831 100644 --- a/alek/output.txt +++ b/alek/output.txt @@ -1 +1 @@ -NoneNone \ No newline at end of file +[(0, '0'), (1, '2'), (2, '4'), (3, '6'), (4, '8'), (5, '10'), (6, '12'), (7, '14'), (8, '16'), (9, '18'), (10, '20'), (11, '22'), (12, '24'), (13, '26'), (14, '28'), (15, '30'), (16, '32'), (17, '34'), (18, '36'), (19, '38'), (20, '40'), (21, '42'), (22, '44'), (23, '46'), (24, '48'), (25, '50'), (26, '52'), (27, '54'), (28, '56'), (29, '58'), (30, '60'), (31, '62'), (32, '64'), (33, '66'), (34, '68'), (35, '70'), (36, '72'), (37, '74'), (38, '76'), (39, '78'), (40, '80'), (41, '82'), (42, '84'), (43, '86'), (44, '88'), (45, '90'), (46, '92'), (47, '94'), (48, '96'), (49, '98'), (50, '100'), (51, '102'), (52, '104'), (53, '106'), (54, '108'), (55, '110'), (56, '112'), (57, '114'), (58, '116'), (59, '118'), (60, '120'), (61, '122'), (62, '124'), (63, '126'), (64, '128'), (65, '130'), (66, '132'), (67, '134'), (68, '136'), (69, '138'), (70, '140'), (71, '142'), (72, '144'), (73, '146'), (74, '148'), (75, '150'), (76, '152'), (77, '154'), (78, '156'), (79, '158'), (80, '160'), (81, '162'), (82, '164'), (83, '166'), (84, '168'), (85, '170'), (86, '172'), (87, '174'), (88, '176'), (89, '178'), (90, '180'), (91, '182'), (92, '184'), (93, '186'), (94, '188'), (95, '190'), (96, '192'), (97, '194'), (98, '196'), (99, '198')] \ No newline at end of file diff --git a/alek/win.txt b/alek/win.txt new file mode 100644 index 0000000000..745bda1b66 --- /dev/null +++ b/alek/win.txt @@ -0,0 +1 @@ +[('neon_utils', '1.0', None, 'neon_utils - small useful functions'), ('pg_buffercache', '1.3', None, 'examine the shared buffer cache'), ('pageinspect', '1.9', None, 'inspect the contents of database pages at a low level'), ('neon', '1.0', None, 'cloud storage for PostgreSQL'), ('test_load', '1.0', None, 'Mock extension'), ('plpgsql', '1.0', '1.0', 'PL/pgSQL procedural language'), ('neon_test_utils', '1.0', None, 'helpers for neon testing and debugging'), ('pg_prewarm', '1.2', None, 'prewarm relation data'), ('hnsw', '0.1.0', None, 'hNsw index')] \ No newline at end of file diff --git a/test_runner/regress/test_download_extensions.py b/test_runner/regress/test_download_extensions.py index 398edd77a1..ede9b37915 100644 --- a/test_runner/regress/test_download_extensions.py +++ b/test_runner/regress/test_download_extensions.py @@ -67,13 +67,19 @@ def test_file_download(neon_env_builder: NeonEnvBuilder): endpoint = env.endpoints.create_start("test_file_download", tenant_id=tenant) with closing(endpoint.connect()) as conn: with conn.cursor() as cur: - # cur.execute("CREATE EXTENSION test_load"); + cur.execute("CREATE TABLE t(key int primary key, value text)") + for i in range(100): + cur.execute(f"insert into t values({i}, {2*i})") + cur.execute("select * from t") + x = cur.fetchall() + log.info(x) + # TODO: we should see the test_ext extension here - other = cur.execute("SELECT * FROM pg_catalog.pg_tables;") - whatsup = cur.execute("select * from pg_available_extensions;") - with open("alek/output.txt", "w") as f: - f.write(str(whatsup) + str(other)) - # this is returning None???? + cur.execute("SELECT * FROM pg_available_extensions") + x = cur.fetchall() + with open("alek/win.txt", "w") as f: + f.write(str(x)) + log.info(x) endpoint.stop() env.pageserver.http_client().tenant_detach(tenant)