Skip to contentSkip to conversation

tests/debugfs_test: Add a shorter timeout when reading sysfs entries

PATCH In review Abdiel Janulgue 2 participants 2 messages Jul 12, 2017 – Jul 14, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/debugfs_test: Add a shorter timeout when reading sysfs entries

This allows us to proceed gracefully without invoking the global CI-level timeout especially when opening the buggy crtc-data file descriptor.

---
 tests/debugfs_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/debugfs_test.c +4 -1
index fb1735b..aefc123 100644
@@ -52,8 +52,11 @@ static void read_and_discard_sysfs_entries(int path_fd, bool is_crc)
 			read_and_discard_sysfs_entries(sub_fd, !strcmp(dirent->d_name, "crc"));
 			close(sub_fd);
 		} else {
-			char *buf = igt_sysfs_get(path_fd, dirent->d_name);
+			char *buf;
 
+			igt_set_timeout(5, "reading sysfs entry");
+			buf = igt_sysfs_get(path_fd, dirent->d_name);
+			igt_reset_timeout();
 			/*
 			 * /crtc-XX/crc/data may fail with -EIO if the CRTC
 			 * is not active.
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Abdiel Janulgue

This allows us to proceed gracefully without invoking the global CI-level timeout especially when opening the buggy crtc-data file descriptor.

---
 tests/debugfs_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/debugfs_test.c +0 -0
index fb1735b..aefc123 100644

tests/debugfs_test.c static void read_and_discard_sysfs_entries(int path_fd, bool is_crc) · line 59

Quoted 9 lines
tests/debugfs_test.c +4 -1
@@ -52,8 +52,11 @@ static void read_and_discard_sysfs_entries(int path_fd, bool is_crc)
 			read_and_discard_sysfs_entries(sub_fd, !strcmp(dirent->d_name, "crc"));
 			close(sub_fd);
 		} else {
-			char *buf = igt_sysfs_get(path_fd, dirent->d_name);
+			char *buf;
 
+			igt_set_timeout(5, "reading sysfs entry");
+			buf = igt_sysfs_get(path_fd, dirent->d_name);
+			igt_reset_timeout();

5 sounds like more than enough.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx