Skip to content

Conversation

@juj
Copy link
Collaborator

@juj juj commented Aug 20, 2025

time_t is long long, test has a narrowing conversion to int.

Fails nondeterministically in http://clbri.com:8010/api/v2/logs/20165/raw_inline

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

It seems likely this is a timing issue since its rely on sleep(1) and assumes the file created/touched before after the sleep will have different timestamps.

I had thought we had a bug open about this test already but I don't see one.

Perhaps you could open a bug and mark this test with @flaky(...bug url...).. that way it should get re-tried automatically in CI (see EMTEST_RETRY_FLAKY, you probably want to set that to a non-zero value in your CI too).

@sbc100
Copy link
Collaborator

sbc100 commented Aug 20, 2025

I found the existing issue : #24905

@juj
Copy link
Collaborator Author

juj commented Aug 20, 2025

Could be, hence the "possibly fix."

Nevertheless, long long shouldn't be narrowed to int, so this change is correct. If there's a filesystem that actually has 64-bit timestamps, then the code would be incorrect there. After PR #17401 this test wasn't adapted accordingly.

@juj
Copy link
Collaborator Author

juj commented Aug 20, 2025

Perhaps you could open a bug and mark this test with @flaky(...bug url...).. that way it should get re-tried automatically in CI (see EMTEST_RETRY_FLAKY, you probably want to set that to a non-zero value in your CI too).

Separate PR.

@juj juj enabled auto-merge (squash) August 20, 2025 20:55
if nodefs and self.get_setting('WASMFS'):
self.skipTest('test requires symlink creation which currently missing from wasmfs+noderawfs')
self.do_runf('stat/test_chmod.c', 'success')
self.do_runf('stat/test_chmod.c', 'success', cflags=['-Werror=conversion'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes me wonder if we should make an effort to enable this in whole test suite.

We currently enable -Werror by default:

self.cflags = ['-Wclosure', '-Werror', '-Wno-limited-postlink-optimizations']

But we don't enable -Wall (which looks like it doesn't actually include -Wconversion anyway )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was expecting you might suggest that, and did give it a quick test before this PR, and was met with a million double -> float narrowing warnings with most tests failing miserably. It would be a nice idea, something to work on later.

I also searched the repo for other uses of .st_mtime and this was the only occurrence that assigned that to an int, other places have been converted already before.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, no worries, I think we are long way from -Wall or -Wextra by default in the test suite !

@juj juj merged commit 616de6b into emscripten-core:main Aug 20, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants