diff --git a/tests/test-libglnx-xattrs.c b/tests/test-libglnx-xattrs.c
index 0b21133a6191e7cc6a6fa12de106f1cf2687dad8..b6f0ac69c05ba8056776fd3174c341a5e9559b05 100644
--- a/tests/test-libglnx-xattrs.c
+++ b/tests/test-libglnx-xattrs.c
@@ -244,6 +244,21 @@ test_xattr_races (void)
   if (!glnx_opendirat (AT_FDCWD, tmpdir, TRUE, &dfd, error))
     goto out;
 
+  /* Support people building/testing on tmpfs https://github.com/flatpak/flatpak/issues/686 */
+  if (fsetxattr (dfd, "user.test", "novalue", strlen ("novalue"), 0) < 0)
+    {
+      if (errno == EOPNOTSUPP)
+        {
+          g_test_skip ("no xattr support");
+          return;
+        }
+      else
+        {
+          glnx_set_error_from_errno (error);
+          goto out;
+        }
+    }
+
   for (guint i = 0; i < nprocs; i++)
     {
       struct XattrWorker *worker = &wdata[i];