Even for orbital launches on the production Falcon 9, schedules are subject to change due to technical glitches or just bad weather. Test launches are subject to both, with technical glitches being nearly part of the plan. For starship launches, there's a nearby town where residents usually get something like 24 hours' notice of an attempt, in case they want to be elsewhere, but that doesn't mean it's guaranteed to happen.
Usually we can tell when they're preparing to by NOTAM and similar just before unless they announce it
Often, tests aren't announced until just before they happen. Musk's twitter seems to be the primary source for this kind of information from SpaceX. Otherwise, some unofficial/fan sources[0] have pretty good information.