Skip to content

filterfs: don't use /dev in test#1848

Merged
github-actions[bot] merged 1 commit intoquay:mainfrom
hdonnay:bug/filterfs-concurrent
May 6, 2026
Merged

filterfs: don't use /dev in test#1848
github-actions[bot] merged 1 commit intoquay:mainfrom
hdonnay:bug/filterfs-concurrent

Conversation

@hdonnay
Copy link
Copy Markdown
Member

@hdonnay hdonnay commented Apr 28, 2026

The TestDev test used the machine's /dev directory to test special files getting filtered out. However when running concurrently with tests starting and stopping PostgreSQL, the test would flap on shm files disappearing from underneath it.

This replaces the test with creating a fifo in a test-created directory, which will not have files change unexpectedly.

@hdonnay hdonnay requested a review from a team as a code owner April 28, 2026 22:44
@hdonnay hdonnay requested review from crozzy and removed request for a team April 28, 2026 22:44
@hdonnay hdonnay force-pushed the bug/filterfs-concurrent branch from f2205c0 to 9c530b4 Compare April 28, 2026 22:45
Comment thread internal/filterfs/fs_test.go Outdated
Comment thread internal/filterfs/fs_test.go Outdated
Comment thread internal/filterfs/fs_test.go Outdated
@hdonnay
Copy link
Copy Markdown
Member Author

hdonnay commented Apr 29, 2026

Ah, yeah, I'm not sure this is testing the right thing now. Will rework a bit.

@hdonnay hdonnay force-pushed the bug/filterfs-concurrent branch from 9c530b4 to 39499d2 Compare April 29, 2026 18:33
@hdonnay hdonnay requested a review from crozzy April 29, 2026 18:36
@hdonnay
Copy link
Copy Markdown
Member Author

hdonnay commented Apr 29, 2026

Updated:

  • use net.Listen to create a unix socket: The previous invocation was not actually creating a "special" file.
  • use slices.DeleteFunc: The ruby arrow was bugging me.
  • misc doc touchups

@hdonnay
Copy link
Copy Markdown
Member Author

hdonnay commented May 4, 2026

@crozzy another look, please

Copy link
Copy Markdown
Contributor

@BradLugo BradLugo left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd like to hear what Crozzy thinks. One minor thing: is it possible to log when an entry is filtered out? If so, what would you think about adding that?

@hdonnay
Copy link
Copy Markdown
Member Author

hdonnay commented May 6, 2026

It'd be odd because we'd have to smuggle a context.Context in the FS struct. Given that this is kind of a hack with the current API, I'd rather not bother.

@BradLugo
Copy link
Copy Markdown
Contributor

BradLugo commented May 6, 2026

Yeah... that's crossed my mind as well. I think it might be nice to plumb context.Context through to this function, so a caller could cancel this process, but maybe this is a discussion for a different PR (might need a totally different API - I don't really want a context.Context field in FS struct).

Copy link
Copy Markdown
Contributor

@crozzy crozzy left a comment

Choose a reason for hiding this comment

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

It lgtm, slices.DeleteFunc is a nice fit. Logging removed files could be nice for debugging but can be discussed/implemented outside of this PR

The `TestDev` test used the machine's `/dev` directory to test special
files getting filtered out. However when running concurrently with
tests starting and stopping PostgreSQL, the test would flap on `shm`
files disappearing from underneath it.

This replaces the test with creating a socket in a test-created directory,
which will not have files change unexpectedly.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I43f94ee1f59234a423dfead4bccddbfb6a6a6964
@hdonnay hdonnay force-pushed the bug/filterfs-concurrent branch from 39499d2 to f99e8f9 Compare May 6, 2026 17:47
@hdonnay
Copy link
Copy Markdown
Member Author

hdonnay commented May 6, 2026

/fast-forward

@github-actions github-actions Bot merged commit f99e8f9 into quay:main May 6, 2026
6 checks passed
@hdonnay hdonnay deleted the bug/filterfs-concurrent branch May 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants