Actions created by bazel's --run_per_test flag inject new environment variables such as TEST_RANDOM_SEED and TEST_RUN_NUMBER, which cause remote execution systems such as Buildbarn to interpret them as new actions. In the case of Buildbarn, this prevents it from using size classes correctly, as the tests are treated as new and any prior learning on the execution of these tests is not considered.
Not sure what the solution might be, but is it possible to have some key that identifies actions without considering this env variables that bazel injects?