Break/Stop loop with MQTT payload/message

  if (length == 9 && strncmp((char*)payload,"volume-up",9)==0) {
    for (int i = 0; i < 1000; i++) {
      Serial.println("up");
      Serial.println(test);
      delay(50);
      if (test == 1) { 
        break;
      }
    }
  }

If the payload IS "volume-up", the for loop starts running. It does NOT end, and is not interrupted, until it completes. During that time, the value of test does not change.

Why do you think that it does/should?