Skip to content

Commit

Permalink
tests: Make test_vm_bit_clear_on_heap_lock more robust again. (#6714)
Browse files Browse the repository at this point in the history
When checking that the contents of the VM page in cache and in
pageserver match, ignore the LSN on the page. It could be different, if
the page was flushed from cache by a checkpoint, for example.

Here's one such failure from the CI that this hopefully fixes:
https://neon-github-public-dev.s3.amazonaws.com/reports/pr-6687/7847132649/index.html#suites/8545ca7650e609b2963d4035816a356b/5f9018db15ef4408/

In the passing, also remove some log.infos from the loop. I added them
while developing the tests, but now they're just noise.
  • Loading branch information
hlinnaka authored Feb 21, 2024
1 parent e0af945 commit 428d9fe
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test_runner/regress/test_vm_bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ def test_vm_bit_clear_on_heap_lock(neon_env_builder: NeonEnvBuilder):

# The VM page in shared buffer cache, and the same page as reconstructed
# by the pageserver, should be equal.
#
# Ignore the LSN on the page though (first 8 bytes). If the dirty
# VM page is flushed from the cache for some reason, it gets WAL-logged,
# which changes the LSN on the page.
cur.execute("select get_raw_page( 'vmtest_lock', 'vm', 0 )")
vm_page_in_cache = (cur.fetchall()[0][0])[:100].hex()
vm_page_in_cache = (cur.fetchall()[0][0])[8:100].hex()
cur.execute("select get_raw_page_at_lsn( 'vmtest_lock', 'vm', 0, pg_current_wal_insert_lsn() )")
vm_page_at_pageserver = (cur.fetchall()[0][0])[:100].hex()
vm_page_at_pageserver = (cur.fetchall()[0][0])[8:100].hex()

assert vm_page_at_pageserver == vm_page_in_cache

Expand Down Expand Up @@ -201,16 +205,6 @@ def test_vm_bit_clear_on_heap_lock(neon_env_builder: NeonEnvBuilder):
for _ in range(1000):
cur.execute("select test_consume_xids(10000);")
for _ in range(1000):
cur.execute(
"select get_raw_page_at_lsn( 'vmtest_lock', 'vm', 0, pg_current_wal_insert_lsn() )"
)
page = (cur.fetchall()[0][0])[:100].hex()
log.info(f"VM page contents: {page}")

cur.execute("select get_raw_page( 'vmtest_lock', 'vm', 0 )")
page = (cur.fetchall()[0][0])[:100].hex()
log.info(f"VM page contents in cache: {page}")

cur.execute("select min(datfrozenxid::text::int) from pg_database")
datfrozenxid = int(cur.fetchall()[0][0])
log.info(f"datfrozenxid {datfrozenxid} locking_xid: {locking_xid}")
Expand Down

1 comment on commit 428d9fe

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2514 tests run: 2385 passed, 0 failed, 129 skipped (full report)


Flaky tests (3)

Postgres 16

  • test_remote_timeline_client_calls_started_metric: debug

Postgres 15

Code coverage* (full report)

  • functions: 28.8% (6752 of 23411 functions)
  • lines: 47.6% (41030 of 86134 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
428d9fe at 2024-02-21T13:47:17.975Z :recycle:

Please sign in to comment.