File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ int main(void) {
3131 assert (ret == 0 );
3232 assert (now - before >= 2 );
3333
34+ // V8 has a bug that allows unsupported parts of this test to run,
35+ // causing the test to fail. poll_win.c is a workaround.
36+ // https://github.com/nodejs/node/issues/51822
3437 // The rest of the test is unsupported on Windows.
3538 if (is_win )
3639 return 0 ;
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <poll.h>
3+ #include <time.h>
4+ #include <unistd.h>
5+
6+ int main (void ) {
7+ struct pollfd fds [4 ];
8+ time_t before , now ;
9+ int ret ;
10+
11+ // Test sleep() behavior.
12+ time (& before );
13+ sleep (1 );
14+ time (& now );
15+ assert (now - before >= 1 );
16+
17+ // Test poll() timeout behavior.
18+ fds [0 ] = (struct pollfd ){.fd = -1 , .events = 0 , .revents = 0 };
19+ time (& before );
20+ ret = poll (fds , 1 , 2000 );
21+ time (& now );
22+ assert (ret == 0 );
23+ assert (now - before >= 2 );
24+
25+ return 0 ;
26+ }
Original file line number Diff line number Diff line change 22require ( '../common' ) ;
33const { testWasiPreview1 } = require ( '../common/wasi' ) ;
44
5- testWasiPreview1 ( [ 'poll' ] ) ;
5+ testWasiPreview1 ( [ process . platform === 'win32' ? 'poll_win' : 'poll' ] ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,3 @@ prefix wasi
66
77[true] # This section applies to all platforms
88
9- # Windows on ARM
10- [$system==win32 && $arch==arm64]
11- # https://github.com/nodejs/node/issues/51822
12- test-wasi-poll: PASS, FLAKY
You canβt perform that action at this time.
0 commit comments